staging: rts5208: fix error return code in rtsx_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 27 Nov 2013 00:38:19 +0000 (08:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Dec 2013 17:03:20 +0000 (09:03 -0800)
Fix to return -ENOMEM instead of 0 when the memory alloc fail
in probe error handling path.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/rtsx.c

index 7882f578a8d946ee7f470bf7dfb0cf6e4a94464b..8586ac5d21447947b26093bc3fdb9014ee83696a 100644 (file)
@@ -896,8 +896,10 @@ static int rtsx_probe(struct pci_dev *pci,
        memset(dev, 0, sizeof(struct rtsx_dev));
 
        dev->chip = kzalloc(sizeof(struct rtsx_chip), GFP_KERNEL);
-       if (dev->chip == NULL)
+       if (dev->chip == NULL) {
+               err = -ENOMEM;
                goto errout;
+       }
 
        spin_lock_init(&dev->reg_lock);
        mutex_init(&(dev->dev_mutex));