Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1712468

[PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'

From Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Newsgroups linux.kernel
Subject [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'
Date 2017-08-15 22:20 +0200
Message-ID <ueQtI-5Vx-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


'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

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-15 22:20 +0200
  Re: [PATCH] scsi: cxlflash: Fix an error handling path in  'cxlflash_disk_attach()' "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com> - 2017-08-16 02:30 +0200
  Re: [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()' "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-08-16 04:20 +0200

csiph-web