Return-Path: Received: from mail-eopbgr700113.outbound.protection.outlook.com ([40.107.70.113]:58560 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728051AbeH3WVW (ORCPT ); Thu, 30 Aug 2018 18:21:22 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Dan Carpenter , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL 3.18 15/25] scsi: aic94xx: fix an error code in aic94xx_init() Date: Thu, 30 Aug 2018 18:17:54 +0000 Message-ID: <20180830181716.36794-15-alexander.levin@microsoft.com> References: <20180830181716.36794-1-alexander.levin@microsoft.com> In-Reply-To: <20180830181716.36794-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 c56741fc4b99..f2d5dc164c00 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -1047,8 +1047,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