From patchwork Tue Aug 15 20:18:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9902531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12ABA60244 for ; Tue, 15 Aug 2017 20:18:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 069C2288B8 for ; Tue, 15 Aug 2017 20:18:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF70F28918; Tue, 15 Aug 2017 20:18:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7122288B8 for ; Tue, 15 Aug 2017 20:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751471AbdHOUSU (ORCPT ); Tue, 15 Aug 2017 16:18:20 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:57055 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbdHOUSU (ORCPT ); Tue, 15 Aug 2017 16:18:20 -0400 Received: from localhost.localdomain ([90.21.173.186]) by mwinf5d77 with ME id xYJH1v00241fZiq03YJHsV; Tue, 15 Aug 2017 22:18:18 +0200 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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP '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 Acked-by: Matthew R. Ochs --- 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; }