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


Groups > linux.kernel > #1712468 > unrolled thread

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

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-08-15 22:20 +0200
Last post2017-08-16 04:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [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

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

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-08-15 22:20 +0200
Subject[PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'
Message-ID<ueQtI-5Vx-15@gated-at.bofh.it>
'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

[toc] | [next] | [standalone]


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

From"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
Date2017-08-16 02:30 +0200
SubjectRe: [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'
Message-ID<ueUnE-8n1-23@gated-at.bofh.it>
In reply to#1712468
> On Aug 15, 2017, at 3:18 PM, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 
> '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>

Yep, that's a bug.

Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

[toc] | [prev] | [next] | [standalone]


#1712593

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2017-08-16 04:20 +0200
Message-ID<ueW66-17t-3@gated-at.bofh.it>
In reply to#1712468
Christophe,

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

Applied to 4.14/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web