lkml.org 
[lkml]   [2018]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 122/159] virtio_net: fix return value check in receive_mergeable()
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Yunjian Wang <wangyunjian@huawei.com>


    [ Upstream commit 03e9f8a05bce7330bcd9c5cc54c8e42d0fcbf993 ]

    The function virtqueue_get_buf_ctx() could return NULL, the return
    value 'buf' need to be checked with NULL, not value 'ctx'.

    Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/virtio_net.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/net/virtio_net.c
    +++ b/drivers/net/virtio_net.c
    @@ -714,7 +714,7 @@ static struct sk_buff *receive_mergeable
    int num_skb_frags;

    buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx);
    - if (unlikely(!ctx)) {
    + if (unlikely(!buf)) {
    pr_debug("%s: rx error: %d buffers out of %d missing\n",
    dev->name, num_buf,
    virtio16_to_cpu(vi->vdev,

    \
     
     \ /
      Last update: 2018-02-23 19:55    [W:4.200 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site