Return-Path: Received: from mail-by2nam01on0094.outbound.protection.outlook.com ([104.47.34.94]:6144 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728053AbeH3WUA (ORCPT ); Thu, 30 Aug 2018 18:20:00 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Dan Carpenter , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL 4.4 20/30] scsi: aic94xx: fix an error code in aic94xx_init() Date: Thu, 30 Aug 2018 18:16:25 +0000 Message-ID: <20180830181533.36683-20-alexander.levin@microsoft.com> References: <20180830181533.36683-1-alexander.levin@microsoft.com> In-Reply-To: <20180830181533.36683-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 662b2321d1b0..913ebb6d0d29 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -1031,8 +1031,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