Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vme: fix error return code in vme_user_probe()

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>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
465ff28d 70d52bce

+2
+2
drivers/staging/vme/devices/vme_user.c
··· 734 734 if (image[i].resource == NULL) { 735 735 dev_warn(&vdev->dev, 736 736 "Unable to allocate slave resource\n"); 737 + err = -ENOMEM; 737 738 goto err_slave; 738 739 } 739 740 image[i].size_buf = PCI_BUF_SIZE; ··· 761 760 if (image[i].resource == NULL) { 762 761 dev_warn(&vdev->dev, 763 762 "Unable to allocate master resource\n"); 763 + err = -ENOMEM; 764 764 goto err_master; 765 765 } 766 766 image[i].size_buf = PCI_BUF_SIZE;