From: Wei Yongjun <yongjun_...@trendmicro.com.cn>

Fix to 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_...@trendmicro.com.cn>
---
 drivers/rpmsg/virtio_rpmsg_bus.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 33d827b..56fceaf 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to