public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [SCSI] qla4xxx: don't free NULL dma pool
@ 2013-01-30  7:07 Dan Carpenter
  2013-01-30 12:41 ` Vikas Chaudhary
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-01-30  7:07 UTC (permalink / raw)
  To: Ravi Anand
  Cc: Vikas Chaudhary, iscsi-driver, James E.J. Bottomley, linux-scsi,
	kernel-janitors

The error path calls dma_pool_free() on this path but "chap_table" is
NULL and "chap_dma" is uninitialized.  It's cleaner to just return
directly.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 1c57c22..887e409 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1404,10 +1404,8 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password,
 	dma_addr_t chap_dma;
 
 	chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
-	if (chap_table == NULL) {
-		ret = -ENOMEM;
-		goto exit_get_chap;
-	}
+	if (chap_table == NULL)
+		return -ENOMEM;
 
 	chap_size = sizeof(struct ql4_chap_table);
 	memset(chap_table, 0, chap_size);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-30 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30  7:07 [patch] [SCSI] qla4xxx: don't free NULL dma pool Dan Carpenter
2013-01-30 12:41 ` Vikas Chaudhary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox