skd: fix error return code in skd_pci_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 30 Oct 2013 05:23:53 +0000 (13:23 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 8 Nov 2013 16:10:29 +0000 (09:10 -0700)
Fix to return -ENOMEM in the skd construct error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/skd_main.c

index ab17bff6b4f9cc2480e7b83a37337012c93d1a97..1a8717fce41d0aaa4383fcea3d40c4ea6ffba8ea 100644 (file)
@@ -5321,8 +5321,10 @@ static int skd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
        skdev = skd_construct(pdev);
-       if (skdev == NULL)
+       if (skdev == NULL) {
+               rc = -ENOMEM;
                goto err_out_regions;
+       }
 
        skd_pci_info(skdev, pci_str);
        pr_info("(%s): %s 64bit\n", skd_name(skdev), pci_str);