From: Swen Schillig Date: Fri, 16 Jul 2010 13:37:40 +0000 (+0200) Subject: [SCSI] zfcp: Prevent access on uninitialized memory. X-Git-Tag: firefly_0821_release~9833^2~1305^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d23948ea38c4c6aa13e4df903dfdd71cabd0e6a3;p=firefly-linux-kernel-4.4.55.git [SCSI] zfcp: Prevent access on uninitialized memory. Initialize allocated memory to zero to prevent access on error. This prevents a possible error in the error handling path. Signed-off-by: Swen Schillig Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 075852f6968c..a08d33a96ec9 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -1005,7 +1005,7 @@ int zfcp_dbf_adapter_register(struct zfcp_adapter *adapter) char dbf_name[DEBUG_MAX_NAME_LEN]; struct zfcp_dbf *dbf; - dbf = kmalloc(sizeof(struct zfcp_dbf), GFP_KERNEL); + dbf = kzalloc(sizeof(struct zfcp_dbf), GFP_KERNEL); if (!dbf) return -ENOMEM;