]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: vme: fix error return code in vme_user_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 13 May 2013 06:05:38 +0000 (14:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 May 2013 21:34:22 +0000 (17:34 -0400)
Fix to return -ENOMEM in the resource alloc 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vme/devices/vme_user.c

index cf2148e8e5c4c83da9a736e49f33fb89c545da98..daec15565a43098c37e6d1ac8d50f56ae99acd88 100644 (file)
@@ -734,6 +734,7 @@ static int vme_user_probe(struct vme_dev *vdev)
                if (image[i].resource == NULL) {
                        dev_warn(&vdev->dev,
                                 "Unable to allocate slave resource\n");
+                       err = -ENOMEM;
                        goto err_slave;
                }
                image[i].size_buf = PCI_BUF_SIZE;
@@ -760,6 +761,7 @@ static int vme_user_probe(struct vme_dev *vdev)
                if (image[i].resource == NULL) {
                        dev_warn(&vdev->dev,
                                 "Unable to allocate master resource\n");
+                       err = -ENOMEM;
                        goto err_master;
                }
                image[i].size_buf = PCI_BUF_SIZE;