diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-05-19 12:17:38 +0200 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-06-05 09:27:13 -0500 |
commit | 9dfe1cc36be27040144238d30da05053db71beb1 (patch) | |
tree | 2e9c8a0d3f477fc13f9db1682dc74aa848315845 /drivers/s390 | |
parent | d26ab06ede83287f99067fee3034c5455a75faf9 (diff) | |
download | kernel_samsung_smdk4412-9dfe1cc36be27040144238d30da05053db71beb1.zip kernel_samsung_smdk4412-9dfe1cc36be27040144238d30da05053db71beb1.tar.gz kernel_samsung_smdk4412-9dfe1cc36be27040144238d30da05053db71beb1.tar.bz2 |
[SCSI] zfcp: Fix mempool pointer for GID_PN request allocation
When allocating memory for GID_PN nameserver requests, the allocation
function stores the pointer to the mempool, but then overwrites the
pointer via memset. Later, the wrong function to free the memory will
be called, since this is based on the stored pointer.
Fix this by first initializing the struct and then storing the pointer.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 41635b1..9a3c138 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1533,19 +1533,16 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool) { struct zfcp_gid_pn_data *data; - if (pool != NULL) { + if (pool) data = mempool_alloc(pool, GFP_ATOMIC); - if (likely(data != NULL)) { - data->ct.pool = pool; - } - } else { + else data = kmem_cache_alloc(zfcp_data.gid_pn_cache, GFP_ATOMIC); - } if (NULL == data) return -ENOMEM; memset(data, 0, sizeof(*data)); + data->ct.pool = pool; sg_init_table(&data->req , 1); sg_init_table(&data->resp , 1); data->ct.req = &data->req; |