kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'
@ 2017-08-15 20:18 Christophe JAILLET
  2017-08-16  0:21 ` Matthew R. Ochs
  2017-08-16  2:11 ` Martin K. Petersen
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2017-08-15 20:18 UTC (permalink / raw)
  To: manoj, mrochs, ukrishn, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, kernel-janitors, Christophe JAILLET

'rc' is known to be 0 at this point.
If 'create_context()' fails, returns -ENOMEM instead of 0 which means
success.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/scsi/cxlflash/superpipe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index ad0f9968ccfb..08da593cb2f6 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -1390,6 +1390,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
 	if (unlikely(!ctxi)) {
 		dev_err(dev, "%s: Failed to create context ctxid=%d\n",
 			__func__, ctxid);
+		rc = -ENOMEM;
 		goto err;
 	}
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread
[parent not found: <20170815201835.781F76A041@b03ledav003.gho.boulder.ibm.com>]

end of thread, other threads:[~2017-08-16  5:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-15 20:18 [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()' Christophe JAILLET
2017-08-16  0:21 ` Matthew R. Ochs
2017-08-16  2:11 ` Martin K. Petersen
     [not found] <20170815201835.781F76A041@b03ledav003.gho.boulder.ibm.com>
2017-08-16  5:32 ` Andrew Donnellan

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).