scsi: aic94xx: fix an error code in aic94xx_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 8 Aug 2018 14:29:09 +0000 (17:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:45:30 +0000 (09:45 +0200)
[ 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 <dan.carpenter@oracle.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/aic94xx/aic94xx_init.c

index 6c838865ac5a7b32fd853aa36a07611e9809adc3..4a4746cc6745f2cc95b2ce0e570a7df05fc77484 100644 (file)
@@ -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)