mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dragos Tatulea <dtatulea@nvidia.com>
To: Feng Liu <feliu@nvidia.com>,
	"xieyongji@bytedance.com" <xieyongji@bytedance.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>
Cc: "virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>,
	Gal Pressman <gal@nvidia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity
Date: Thu, 4 May 2023 17:19:55 +0000	[thread overview]
Message-ID: <209b4b364facec3cc26f3d12acd4b466b9278b47.camel@nvidia.com> (raw)
In-Reply-To: <26ee2c04-7844-14fe-5cba-fe30172f075f@nvidia.com>

On Thu, 2023-05-04 at 13:08 -0400, Feng Liu wrote:
> 
> 
> On 2023-05-04 a.m.9:50, Dragos Tatulea wrote:
> > External email: Use caution opening links or attachments
> > 
> > 
> > The referenced patch calls set_vq_affinity without checking if the op is
> > valid. This patch adds the check.
> > 
> > Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading
> > mechanism")
> > Reviewed-by: Gal Pressman <gal@nvidia.com>
> > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > ---
> >   drivers/virtio/virtio_vdpa.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> > index eb6aee8c06b2..989e2d7184ce 100644
> > --- a/drivers/virtio/virtio_vdpa.c
> > +++ b/drivers/virtio/virtio_vdpa.c
> > @@ -385,7 +385,9 @@ static int virtio_vdpa_find_vqs(struct virtio_device
> > *vdev, unsigned int nvqs,
> >                          err = PTR_ERR(vqs[i]);
> >                          goto err_setup_vq;
> >                  }
> > -               ops->set_vq_affinity(vdpa, i, &masks[i]);
> > +
> > +               if (ops->set_vq_affinity)
> > +                       ops->set_vq_affinity(vdpa, i, &masks[i]);
> if ops->set_vq_affinity is NULL, should give an error code to err, and 
> return err
> 
I don't think so: the set_vq_affinity is marked as optional.

> >          }
> > 
> >          cb.callback = virtio_vdpa_config_cb;
> > --
> > 2.40.1
> > 



  reply	other threads:[~2023-05-04 17:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 13:50 Dragos Tatulea
2023-05-04 17:08 ` Feng Liu
2023-05-04 17:19   ` Dragos Tatulea [this message]
2023-05-04 17:46     ` Feng Liu
2023-05-04 18:51   ` Michael S. Tsirkin
2023-05-04 22:47     ` Feng Liu
2023-05-12 12:51     ` Dragos Tatulea
2023-05-12 13:30       ` Michael S. Tsirkin
2023-05-04 17:47 ` Feng Liu

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=209b4b364facec3cc26f3d12acd4b466b9278b47.camel@nvidia.com \
    --to=dtatulea@nvidia.com \
    --cc=feliu@nvidia.com \
    --cc=gal@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xieyongji@bytedance.com \
    --cc=xuanzhuo@linux.alibaba.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

all inboxes | Powered by JetHome®