From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr720126.outbound.protection.outlook.com ([40.107.72.126]:5968 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727336AbeH3WLx (ORCPT ); Thu, 30 Aug 2018 18:11:53 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Dan Carpenter , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 075/113] scsi: aic94xx: fix an error code in aic94xx_init() Date: Thu, 30 Aug 2018 18:07:34 +0000 Message-ID: <20180830180714.36167-9-alexander.levin@microsoft.com> References: <20180830180714.36167-1-alexander.levin@microsoft.com> In-Reply-To: <20180830180714.36167-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Dan Carpenter [ Upstream commit 0756c57bce3d26da2592d834d8910b6887021701 ] We accidentally return success instead of -ENOMEM on this error path. Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Signed-off-by: Dan Carpenter Reviewed-by: Johannes Thumshirn Reviewed-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/aic94xx/aic94xx_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic= 94xx_init.c index 80e5b283fd81..1391e5f35918 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) =20 aic94xx_transport_template =3D sas_domain_attach_transport(&aic94xx_transport_functions); - if (!aic94xx_transport_template) + if (!aic94xx_transport_template) { + err =3D -ENOMEM; goto out_destroy_caches; + } =20 err =3D pci_register_driver(&aic94xx_pci_driver); if (err) --=20 2.17.1