From patchwork Wed Aug 8 14:29:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10560335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61EB214C0 for ; Wed, 8 Aug 2018 15:59:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F9F12B17E for ; Wed, 8 Aug 2018 15:59:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43A9B2B195; Wed, 8 Aug 2018 15:59:54 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 E7ECE2B17E for ; Wed, 8 Aug 2018 15:59:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727584AbeHHSUK (ORCPT ); Wed, 8 Aug 2018 14:20:10 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:37056 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbeHHSUK (ORCPT ); Wed, 8 Aug 2018 14:20:10 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w78FxTcO041598; Wed, 8 Aug 2018 15:59:30 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 : in-reply-to; s=corp-2018-07-02; bh=JUzGgOJLmnNahZcfeIBuUfN5xpqdWsGIlkSqsi+TEgY=; b=arLD9N1rWuUzgUzp0sD7U1DzXwfyI/hsf3brX4P9TK9d/N6s5hVZdVhVKnDH8WITNu6n 0hq/2IcXDjeO5zfp2wcDIyZ+BlwOIzcIe/rO9ZU3WcZwm5bSpV6DeS4zr9PC+xrsfB18 bcwpItRQ4fIM8ABBTs0f5WzoKnonQUmZv1TMTIJqnEe5cD0l1ZhPVSNZhGQc72Mqju5y hfIcbzUcHvKDnuFDMu0LL4YzHfQsBOPgWaNsqmnu1DKzljsLPqWiUhkNLvulrNU+9wzC iK/AC+McmZD3IUHk2rrqZN2IWo/1NwLukz5gOmblvJa2Wr3vayZ7+5R8QoAK7EtvIvsr sA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2kn43nxe27-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 08 Aug 2018 15:59:30 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w78FxTlt001772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Aug 2018 15:59:29 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w78FxSda025678; Wed, 8 Aug 2018 15:59:28 GMT Received: from kili.mountain (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 08 Aug 2018 07:29:17 -0700 Date: Wed, 8 Aug 2018 17:29:09 +0300 From: Dan Carpenter To: "James E.J. Bottomley" Cc: "Martin K. Petersen" , Bart Van Assche , Johannes Thumshirn , Hannes Reinecke , linux-scsi@vger.kernel.org, John Garry , kernel-janitors@vger.kernel.org Subject: [PATCH v2] scsi: aic94xx: fix an error code in aic94xx_init() Message-ID: <20180808142909.lzdbwxxqt5gwzrzl@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7b63e8da-2a3b-b375-08e0-784117843a93@huawei.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8978 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=452 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808080163 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 accidentally return success instead of -ENOMEM on this error path. Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Signed-off-by: Dan Carpenter Reviewed-by: John Garry --- v2: return -ENOMEM instead of -ENODEV diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index 80e5b283fd81..cb8191afc1dc 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -1030,8 +1030,10 @@ static int __init aic94xx_init(void) aic94xx_transport_template = sas_domain_attach_transport(&aic94xx_transport_functions); - if (!aic94xx_transport_template) + if (!aic94xx_transport_template) { + err = -ENOMEM; goto out_destroy_caches; + } err = pci_register_driver(&aic94xx_pci_driver); if (err)