From patchwork Thu Feb 8 23:50:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10208155 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 A4E5C60247 for ; Fri, 9 Feb 2018 00:03:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 954272966A for ; Fri, 9 Feb 2018 00:03:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 891FF29672; Fri, 9 Feb 2018 00:03:21 +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,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 2A15D2966A for ; Fri, 9 Feb 2018 00:03:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752132AbeBIADI (ORCPT ); Thu, 8 Feb 2018 19:03:08 -0500 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:45426 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751941AbeBIADH (ORCPT ); Thu, 8 Feb 2018 19:03:07 -0500 X-Greylist: delayed 675 seconds by postgrey-1.27 at vger.kernel.org; Thu, 08 Feb 2018 19:03:07 EST Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id jvxqe1xo4QvTSjvxqeDPcG; Thu, 08 Feb 2018 16:50:51 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.89_1) (envelope-from ) id 1ejvxq-0001WJ-Rq; Thu, 08 Feb 2018 16:50:50 -0700 From: Long Li To: "K . Y . Srinivasan" , Haiyang Zhang , "James E . J . Bottomley" , devel@linuxdriverproject.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Long Li , Dan Carpenter , "Martin K . Petersen" Subject: [PATCH] scsi: storvsc: missing error code in storvsc_probe() Date: Thu, 8 Feb 2018 16:50:40 -0700 Message-Id: <20180208235040.5803-1-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.15.1 X-CMAE-Envelope: MS4wfGk9Q9jzFMhD4wdqDuGDLPZgMG5EJexbwlcHJ70kK70ar3pbpcxZt8gViAIGapAqVfSJoTPo9AiwungjcoeiifauEgC6GbOztvArC3t34HMgyJMnPloP 2l7dogB0xNmpQkuEgm20MBsku4MjjPl79cDvkeT/eFXL+1MqdXslByKf5IFShDwVGTeigte21T13bPcLEMq3f9Un/UNxT+d8i9BSV4YZbR/Wi6HFZqSd1zO3 5wQOhJQOb7yD5lljJf5PKtMii8NSxWjLIkZYHWISvFAVvw2pBdauMxxSKzXDOS4W0eH5A0QwrThaWBMe2jDXs4InLgxwwlGmeR6iXqIPfx/sLjsmqnALUnnU WuwWdIBPHDNkRT1ibkBAMRhMUcXjmfuwTvn5p8gH1qXa91KlN4ZEM2mx++fQgogoX27yLATrQ8TgYvxE1u7GwC8pcbuYlVDemyNHJofWOSDGiousvHYXkU6b 70BAHwG0Mc2vFCOMblftLI+NN1LlZM8pLBAs4pi74HCCTWeSLYh7C14mej72qSlU1lqmbg+Pa8rpMZpX 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 From: Long Li This patch backports upstream commit ca8dc694045e9aa248e9916e0f614deb0494cb3d for 4.14-stable. commit ca8dc694045e9aa248e9916e0f614deb0494cb3d: We should set the error code if fc_remote_port_add() fails. Cc: #v4.12+ Fixes: daf0cd445a21 ("scsi: storvsc: Add support for FC rport.") Signed-off-by: Dan Carpenter Reviewed-by: Cathy Avery Acked-by: K. Y. Srinivasan Signed-off-by: Martin K. Petersen Signed-off-by: Long Li --- drivers/scsi/storvsc_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 5e7200f..c17ccb9 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1826,8 +1826,10 @@ static int storvsc_probe(struct hv_device *device, fc_host_node_name(host) = stor_device->node_name; fc_host_port_name(host) = stor_device->port_name; stor_device->rport = fc_remote_port_add(host, 0, &ids); - if (!stor_device->rport) + if (!stor_device->rport) { + ret = -ENOMEM; goto err_out3; + } } #endif return 0;