From: Jason Wang <jasowang@redhat.com> To: Eli Cohen <elic@nvidia.com> Cc: mst <mst@redhat.com>, virtualization <virtualization@lists.linux-foundation.org>, linux-kernel <linux-kernel@vger.kernel.org>, Si-Wei Liu <si-wei.liu@oracle.com> Subject: Re: [PATCH v4 1/3] vdpa: Fix error logic in vdpa_nl_cmd_dev_get_doit Date: Tue, 10 May 2022 10:40:44 +0800 [thread overview] Message-ID: <CACGkMEs35nLewkMzP0p4mBHtiYb0DQaMmnG_EEpUad18ygnqxg@mail.gmail.com> (raw) In-Reply-To: <20220508163317.204673-2-elic@nvidia.com> On Mon, May 9, 2022 at 12:33 AM Eli Cohen <elic@nvidia.com> wrote: > > In vdpa_nl_cmd_dev_get_doit(), ff the call to genlmsg_reply() fails we I guess you mean "if" here? > must not call nlmsg_free() since this is done inside genlmsg_reply(). > > Fix it. > > Fixes: bc0d90ee021f ("vdpa: Enable user to query vdpa device info") > Signed-off-by: Eli Cohen <elic@nvidia.com> Other than the above typo. Acked-by: Jason Wang <jasowang@redhat.com> > --- > drivers/vdpa/vdpa.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index 2b75c00b1005..fac89a0d8178 100644 > --- a/drivers/vdpa/vdpa.c > +++ b/drivers/vdpa/vdpa.c > @@ -756,14 +756,19 @@ static int vdpa_nl_cmd_dev_get_doit(struct sk_buff *skb, struct genl_info *info) > goto mdev_err; > } > err = vdpa_dev_fill(vdev, msg, info->snd_portid, info->snd_seq, 0, info->extack); > - if (!err) > - err = genlmsg_reply(msg, info); > + if (err) > + goto mdev_err; > + > + err = genlmsg_reply(msg, info); > + put_device(dev); > + mutex_unlock(&vdpa_dev_mutex); > + return err; > + > mdev_err: > put_device(dev); > err: > mutex_unlock(&vdpa_dev_mutex); > - if (err) > - nlmsg_free(msg); > + nlmsg_free(msg); > return err; > } > > -- > 2.35.1 >
WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com> To: Eli Cohen <elic@nvidia.com> Cc: Si-Wei Liu <si-wei.liu@oracle.com>, virtualization <virtualization@lists.linux-foundation.org>, linux-kernel <linux-kernel@vger.kernel.org>, mst <mst@redhat.com> Subject: Re: [PATCH v4 1/3] vdpa: Fix error logic in vdpa_nl_cmd_dev_get_doit Date: Tue, 10 May 2022 10:40:44 +0800 [thread overview] Message-ID: <CACGkMEs35nLewkMzP0p4mBHtiYb0DQaMmnG_EEpUad18ygnqxg@mail.gmail.com> (raw) In-Reply-To: <20220508163317.204673-2-elic@nvidia.com> On Mon, May 9, 2022 at 12:33 AM Eli Cohen <elic@nvidia.com> wrote: > > In vdpa_nl_cmd_dev_get_doit(), ff the call to genlmsg_reply() fails we I guess you mean "if" here? > must not call nlmsg_free() since this is done inside genlmsg_reply(). > > Fix it. > > Fixes: bc0d90ee021f ("vdpa: Enable user to query vdpa device info") > Signed-off-by: Eli Cohen <elic@nvidia.com> Other than the above typo. Acked-by: Jason Wang <jasowang@redhat.com> > --- > drivers/vdpa/vdpa.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index 2b75c00b1005..fac89a0d8178 100644 > --- a/drivers/vdpa/vdpa.c > +++ b/drivers/vdpa/vdpa.c > @@ -756,14 +756,19 @@ static int vdpa_nl_cmd_dev_get_doit(struct sk_buff *skb, struct genl_info *info) > goto mdev_err; > } > err = vdpa_dev_fill(vdev, msg, info->snd_portid, info->snd_seq, 0, info->extack); > - if (!err) > - err = genlmsg_reply(msg, info); > + if (err) > + goto mdev_err; > + > + err = genlmsg_reply(msg, info); > + put_device(dev); > + mutex_unlock(&vdpa_dev_mutex); > + return err; > + > mdev_err: > put_device(dev); > err: > mutex_unlock(&vdpa_dev_mutex); > - if (err) > - nlmsg_free(msg); > + nlmsg_free(msg); > return err; > } > > -- > 2.35.1 > _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2022-05-10 2:41 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-08 16:33 [PATCH v4 0/3] Show statistics for a vdpa device Eli Cohen 2022-05-08 16:33 ` [PATCH v4 1/3] vdpa: Fix error logic in vdpa_nl_cmd_dev_get_doit Eli Cohen 2022-05-10 2:40 ` Jason Wang [this message] 2022-05-10 2:40 ` Jason Wang 2022-05-08 16:33 ` [PATCH v4 2/3] vdpa: Add support for querying vendor statistics Eli Cohen 2022-05-08 16:33 ` [PATCH v4 3/3] vdpa/mlx5: Add support for reading descriptor statistics Eli Cohen 2022-05-10 3:01 ` Jason Wang 2022-05-10 3:01 ` Jason Wang 2022-05-10 6:24 ` Eli Cohen
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=CACGkMEs35nLewkMzP0p4mBHtiYb0DQaMmnG_EEpUad18ygnqxg@mail.gmail.com \ --to=jasowang@redhat.com \ --cc=elic@nvidia.com \ --cc=linux-kernel@vger.kernel.org \ --cc=mst@redhat.com \ --cc=si-wei.liu@oracle.com \ --cc=virtualization@lists.linux-foundation.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.