drivers/rpmsg/virtio_rpmsg_bus.c: fix error return code in rpmsg_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 29 Apr 2013 23:17:09 +0000 (16:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:13 +0000 (18:28 -0700)
Return a negative error code from the error handling case instead of 0, as
returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rpmsg/virtio_rpmsg_bus.c

index a59684b..7861f11 100644 (file)
@@ -951,8 +951,10 @@ static int rpmsg_probe(struct virtio_device *vdev)
        bufs_va = dma_alloc_coherent(vdev->dev.parent->parent,
                                RPMSG_TOTAL_BUF_SPACE,
                                &vrp->bufs_dma, GFP_KERNEL);
-       if (!bufs_va)
+       if (!bufs_va) {
+               err = -ENOMEM;
                goto vqs_del;
+       }
 
        dev_dbg(&vdev->dev, "buffers: va %p, dma 0x%llx\n", bufs_va,
                                        (unsigned long long)vrp->bufs_dma);