From patchwork Tue Jan 16 10:40:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10166441 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 BE993601E7 for ; Tue, 16 Jan 2018 10:40:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA8B628426 for ; Tue, 16 Jan 2018 10:40:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BD8228446; Tue, 16 Jan 2018 10:40:45 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham 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 2A3DC28426 for ; Tue, 16 Jan 2018 10:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbeAPKkn (ORCPT ); Tue, 16 Jan 2018 05:40:43 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:59126 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbeAPKkm (ORCPT ); Tue, 16 Jan 2018 05:40:42 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0GAQs5H097082; Tue, 16 Jan 2018 10:40:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=7foH6p4fUN53ENfGtqtMDCKEPKE6X3G/I374Q6OZ1mo=; b=tHFRzvrQfWaTgXtnpzL/lKxZNDgrmyDGfvI0Mv5FRYcE9ueBI+XXR8dTHVe4jxB9p5Q2 J7nsOKPAobsROF3RPPPo6DQWB7kFxEnBI/4iRXo8Wg7pngibaK+iZxmFwbxovw0M4Niu qS0CxSgS9iTZP2UTmQBmU5oZ/bisLQxKS0vkip9ZelBHWJh9qZgFmxu3+0XUBdwb567H oU1ZPqYZ/QUctuyvQ80uxBwf9rWgCmL29tX0D5aYy+Lv1B0PVEeqQcucpkS4t2FbxUfp dtdmhEFdXyZaFRjJwbEjDzAgn8Kyof1aB8lhXzp6o6vCTSsTntbepHZGcc8bS7IlzGPM iQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2fhf8m86xd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Jan 2018 10:40:34 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0GAeXtn030540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 16 Jan 2018 10:40:34 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0GAeWfH013492; Tue, 16 Jan 2018 10:40:32 GMT Received: from mwanda (/197.157.0.32) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 16 Jan 2018 02:40:32 -0800 Date: Tue, 16 Jan 2018 13:40:22 +0300 From: Dan Carpenter To: "K. Y. Srinivasan" , Cathy Avery Cc: Haiyang Zhang , Stephen Hemminger , "James E.J. Bottomley" , "Martin K. Petersen" , devel@linuxdriverproject.org, linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] scsi: storvsc: missing error code in storvsc_probe() Message-ID: <20180116104022.GA3517@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.2 (2017-12-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8775 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=864 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801160153 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 We should set the error code if fc_remote_port_add() fails. Fixes: daf0cd445a21 ("scsi: storvsc: Add support for FC rport.") Signed-off-by: Dan Carpenter Reviewed-by: Cathy Avery Acked-by: K. Y. Srinivasan diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 3b3d1d050cac..40fc7a590e81 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1834,8 +1834,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_out4; + } } #endif return 0;