Skip to content

Commit

Permalink
[SCSI] zfcp: Prevent access on uninitialized memory.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Swen Schillig authored and James Bottomley committed Jul 28, 2010
1 parent 2d1e547 commit d23948e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/scsi/zfcp_dbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d23948e

Please sign in to comment.