2013-03-22 13:16:13

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] rpmsg: fix error return code in rpmsg_probe()

From: Wei Yongjun <[email protected]>

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 <[email protected]>
---
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);


2013-03-25 23:00:24

by Rusty Russell

[permalink] [raw]
Subject: Re: [PATCH -next] rpmsg: fix error return code in rpmsg_probe()

Wei Yongjun <[email protected]> writes:
> From: Wei Yongjun <[email protected]>
>
> 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 <[email protected]>

Thanks, I've taken this for the moment in my pending queue.

Which brings the questionL Ohad, did you want to keep pushing your own
tree or want to send rpmsg stuff via my virtio-next tree?

Cheers,
Rusty.

2013-03-26 12:25:54

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: [PATCH -next] rpmsg: fix error return code in rpmsg_probe()

On Mon, Mar 25, 2013 at 12:11 PM, Rusty Russell <[email protected]> wrote:
> Wei Yongjun <[email protected]> writes:
>> From: Wei Yongjun <[email protected]>
>>
>> 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 <[email protected]>
>
> Thanks, I've taken this for the moment in my pending queue.

Please note that akpm already picked this up via the -mm tree very
promptly after Wei submitted this.

> Which brings the questionL Ohad, did you want to keep pushing your own
> tree or want to send rpmsg stuff via my virtio-next tree?

I'm thinking I'll keep pushing my tree for now but I'm taking this as an
open offer from you :)

Thanks,
Ohad.