* [PATCH 1/1] scsi: snic: fix improper return value
@ 2016-12-04 6:02 Pan Bian
0 siblings, 0 replies; only message in thread
From: Pan Bian @ 2016-12-04 6:02 UTC (permalink / raw)
To: Narsimhulu Musini, Sesidhar Baddela, James E.J. Bottomley,
Martin K. Petersen, linux-scsi
Cc: linux-kernel, Pan Bian
From: Pan Bian <bianpan2016@163.com>
When the calls to mempool_create_slab_pool() return unexpected values,
the value of return variable ret is 0. 0 means no error. Thus, the
caller of fnic_probe() cannot detect the error, and may be misled. This
patch fixes the bug, assigning "-ENOMEM" to ret before calling
mempool_create_slab_pool().
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189061
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
drivers/scsi/snic/snic_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c
index 396b32d..e8907e6 100644
--- a/drivers/scsi/snic/snic_main.c
+++ b/drivers/scsi/snic/snic_main.c
@@ -586,6 +586,7 @@
for (i = 0; i < SNIC_IO_LOCKS; i++)
spin_lock_init(&snic->io_req_lock[i]);
+ ret = -ENOMEM;
pool = mempool_create_slab_pool(2,
snic_glob->req_cache[SNIC_REQ_CACHE_DFLT_SGL]);
if (!pool) {
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-12-04 6:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-04 6:02 [PATCH 1/1] scsi: snic: fix improper return value Pan Bian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).