Skip to content

Commit 3119b48

Browse files
Wei Yongjuntorvalds
authored andcommitted
drivers/rpmsg/virtio_rpmsg_bus.c: fix error return code in rpmsg_probe()
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>
1 parent ca0dde9 commit 3119b48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/rpmsg/virtio_rpmsg_bus.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,10 @@ static int rpmsg_probe(struct virtio_device *vdev)
951951
bufs_va = dma_alloc_coherent(vdev->dev.parent->parent,
952952
RPMSG_TOTAL_BUF_SPACE,
953953
&vrp->bufs_dma, GFP_KERNEL);
954-
if (!bufs_va)
954+
if (!bufs_va) {
955+
err = -ENOMEM;
955956
goto vqs_del;
957+
}
956958

957959
dev_dbg(&vdev->dev, "buffers: va %p, dma 0x%llx\n", bufs_va,
958960
(unsigned long long)vrp->bufs_dma);

0 commit comments

Comments
 (0)