Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbdHOUSV (ORCPT ); Tue, 15 Aug 2017 16:18:21 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:41171 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbdHOUSU (ORCPT ); Tue, 15 Aug 2017 16:18:20 -0400 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 15 Aug 2017 22:18:18 +0200 X-ME-IP: 90.21.173.186 From: Christophe JAILLET To: manoj@linux.vnet.ibm.com, mrochs@linux.vnet.ibm.com, ukrishn@linux.vnet.ibm.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()' Date: Tue, 15 Aug 2017 22:18:14 +0200 Message-Id: <20170815201814.12929-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 697 Lines: 23 '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 --- 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