Jelajahi Sumber

[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 <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Swen Schillig 15 tahun lalu
induk
melakukan
d23948ea38
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      drivers/s390/scsi/zfcp_dbf.c

+ 1 - 1
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];
 	char dbf_name[DEBUG_MAX_NAME_LEN];
 	struct zfcp_dbf *dbf;
 	struct zfcp_dbf *dbf;
 
 
-	dbf = kmalloc(sizeof(struct zfcp_dbf), GFP_KERNEL);
+	dbf = kzalloc(sizeof(struct zfcp_dbf), GFP_KERNEL);
 	if (!dbf)
 	if (!dbf)
 		return -ENOMEM;
 		return -ENOMEM;