]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[SCSI] zfcp: Zero memory for gpn_ft and adisc requests
authorChristof Schmitt <christof.schmitt@de.ibm.com>
Fri, 30 Apr 2010 16:09:37 +0000 (18:09 +0200)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 2 May 2010 19:42:34 +0000 (15:42 -0400)
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>
drivers/s390/scsi/zfcp_fc.c

index 2a1cbb74b99b624cb7bec855b16caba61dd7cf0f..6f8ab43a485671c4a72f4a68b6e3bf448a8fd56d 100644 (file)
@@ -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;
 
@@ -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;