From: Jason Wang <jasowang@redhat.com>
To: wangyunjian <wangyunjian@huawei.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "mst@redhat.com" <mst@redhat.com>, caihe <caihe@huawei.com>
Subject: Re: [PATCH net] virtio_net: fix return value check in receive_mergeable()
Date: Tue, 5 Dec 2017 10:59:18 +0800 [thread overview]
Message-ID: <1bebe20f-e20a-e2ff-657a-8a7456e24494@redhat.com> (raw)
In-Reply-To: <34EFBCA9F01B0748BEB6B629CE643AE60C6C0F85@dggemm513-mbx.china.huawei.com>
On 2017年12月04日 19:25, wangyunjian wrote:
>
>> -----Original Message-----
>> From: Jason Wang [mailto:jasowang@redhat.com]
>> Sent: Monday, December 04, 2017 3:10 PM
>> To: wangyunjian <wangyunjian@huawei.com>; linux-
>> kernel@vger.kernel.org
>> Cc: mst@redhat.com; caihe <caihe@huawei.com>
>> Subject: Re: [PATCH net] virtio_net: fix return value check in
>> receive_mergeable()
>>
>>
>>
>> On 2017年12月04日 14:02, wangyunjian wrote:
>>> From: Yunjian Wang <wangyunjian@huawei.com>
>>>
>>> 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>
>>> ---
>>> drivers/net/virtio_net.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>>> index 19a985e..559b215 100644
>>> --- a/drivers/net/virtio_net.c
>>> +++ b/drivers/net/virtio_net.c
>>> @@ -756,7 +756,7 @@ static struct sk_buff *receive_mergeable(struct
>> net_device *dev,
>>> 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,
>> Hi:
>>
>> The path looks good but I'm not sure this is a real fix since we add
>> data and ctx simultaneously in virtqueue_add_inbuf_ctx().
>>
>> Any bad result you see without this patch?
>>
> Now no problem has been found yet, and I found it when reviewing the code.
>
> Thanks
Then I think it's better to go net-next. Michael, any idea on this?
Thanks
>
>> Thanks
prev parent reply other threads:[~2017-12-05 2:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 6:02 wangyunjian
2017-12-04 7:10 ` Jason Wang
2017-12-04 11:25 ` wangyunjian
2017-12-05 2:59 ` Jason Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1bebe20f-e20a-e2ff-657a-8a7456e24494@redhat.com \
--to=jasowang@redhat.com \
--cc=caihe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=wangyunjian@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome