Sjur Brændeland
2013-Mar-22 15:24 UTC
[PATCH virtio-next 1/2] caif_virtio: Use vringh_notify_enable correctly
Check on the correct return value from vringh_notify_enable_kern(). It returns false if more packets are available, not true. Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> --- Hi, This patch applies to Rusty's virtio-next branch. Thanks, Sjur drivers/net/caif/caif_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index f6caa1e..fb80765 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c @@ -318,7 +318,7 @@ exit: /* Really out of patckets? (stolen from virtio_net)*/ napi_complete(napi); - if (unlikely(vringh_notify_enable_kern(cfv->vr_rx)) && + if (unlikely(!vringh_notify_enable_kern(cfv->vr_rx)) && napi_schedule_prep(napi)) { vringh_notify_disable_kern(cfv->vr_rx); __napi_schedule(napi); -- 1.7.9.5
Sjur Brændeland
2013-Mar-22 15:24 UTC
[PATCH virtio-next 2/2] caif_virtio: Check that vringh_config is not null
Check that vringh_config is not NULL before using it. Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> --- Hi, This patch applies to Rusty's virtio-next branch. Thanks, Sjur drivers/net/caif/caif_virtio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index fb80765..316b184 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c @@ -670,6 +670,10 @@ static int cfv_probe(struct virtio_device *vdev) spin_lock_init(&cfv->tx_lock); /* Get the RX virtio ring. This is a "host side vring". */ + err = -ENODEV; + if (!vdev->vringh_config || !vdev->vringh_config->find_vrhs) + goto err; + err = vdev->vringh_config->find_vrhs(vdev, 1, &cfv->vr_rx, &vrh_cbs); if (err) goto err; -- 1.7.9.5
Rusty Russell
2013-Mar-24 03:52 UTC
[PATCH virtio-next 2/2] caif_virtio: Check that vringh_config is not null
Sjur Br?ndeland <sjur.brandeland at stericsson.com> writes:> Check that vringh_config is not NULL before using it. > > Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com>Both applied. Thanks, Rusty.
Apparently Analagous Threads
- [PATCH virtio-next 1/2] caif_virtio: Use vringh_notify_enable correctly
- [PATCHv3 vringh] caif_virtio: Introduce caif over virtio
- [PATCHv3 vringh] caif_virtio: Introduce caif over virtio
- Wrappers for vringh (was Re: [PATCHv2 vringh 1/3] remoteproc: Add support for vringh (Host vrings))
- Wrappers for vringh (was Re: [PATCHv2 vringh 1/3] remoteproc: Add support for vringh (Host vrings))