Skip to content

Commit

Permalink
[SCSI] zfcp: Zero memory for gpn_ft and adisc requests
Browse files Browse the repository at this point in the history
With debug kernels, the memory allocated with kmem_cache_alloc might
be initialized with the poison values 6b and a5. Use kmem_cache_zalloc
instead of kmem_cache_alloc to get zeroed memory and not send invalid
requests.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Christof Schmitt authored and James Bottomley committed May 2, 2010
1 parent 64deb6e commit 6e51f08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/s390/scsi/zfcp_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ static int zfcp_fc_adisc(struct zfcp_port *port)
struct zfcp_adapter *adapter = port->adapter;
int ret;

adisc = kmem_cache_alloc(zfcp_data.adisc_cache, GFP_ATOMIC);
adisc = kmem_cache_zalloc(zfcp_data.adisc_cache, GFP_ATOMIC);
if (!adisc)
return -ENOMEM;

Expand Down Expand Up @@ -493,7 +493,7 @@ static struct zfcp_fc_gpn_ft *zfcp_alloc_sg_env(int buf_num)
if (!gpn_ft)
return NULL;

req = kmem_cache_alloc(zfcp_data.gpn_ft_cache, GFP_KERNEL);
req = kmem_cache_zalloc(zfcp_data.gpn_ft_cache, GFP_KERNEL);
if (!req) {
kfree(gpn_ft);
gpn_ft = NULL;
Expand Down

0 comments on commit 6e51f08

Please sign in to comment.