All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Bo Liu <liubo03@inspur.com>
Cc: mst <mst@redhat.com>,
	virtualization <virtualization@lists.linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] virtio: Check dev_set_name() return value
Date: Fri, 8 Jul 2022 14:00:09 +0800	[thread overview]
Message-ID: <CACGkMEujMgP=QbQte6Hjv2DXp7TYJXQvu8uK3=h130pcr6eYsg@mail.gmail.com> (raw)
In-Reply-To: <20220707031751.4802-1-liubo03@inspur.com>

On Thu, Jul 7, 2022 at 11:18 AM Bo Liu <liubo03@inspur.com> wrote:
>
> It's possible that dev_set_name() returns -ENOMEM, catch and handle this.
>
> Signed-off-by: Bo Liu <liubo03@inspur.com>

Acked-by: Jason Wang <jasowang@redhat.com>

> ---
>  drivers/virtio/virtio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index 7deeed30d1f3..ddd4466da83b 100644
> --- a/drivers/virtio/virtio.c
> +++ b/drivers/virtio/virtio.c
> @@ -428,7 +428,9 @@ int register_virtio_device(struct virtio_device *dev)
>                 goto out;
>
>         dev->index = err;
> -       dev_set_name(&dev->dev, "virtio%u", dev->index);
> +       err = dev_set_name(&dev->dev, "virtio%u", dev->index);
> +       if (err)
> +               goto out_ida_remove;
>
>         err = virtio_device_of_init(dev);
>         if (err)
> --
> 2.27.0
>


WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: Bo Liu <liubo03@inspur.com>
Cc: virtualization <virtualization@lists.linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>, mst <mst@redhat.com>
Subject: Re: [PATCH] virtio: Check dev_set_name() return value
Date: Fri, 8 Jul 2022 14:00:09 +0800	[thread overview]
Message-ID: <CACGkMEujMgP=QbQte6Hjv2DXp7TYJXQvu8uK3=h130pcr6eYsg@mail.gmail.com> (raw)
In-Reply-To: <20220707031751.4802-1-liubo03@inspur.com>

On Thu, Jul 7, 2022 at 11:18 AM Bo Liu <liubo03@inspur.com> wrote:
>
> It's possible that dev_set_name() returns -ENOMEM, catch and handle this.
>
> Signed-off-by: Bo Liu <liubo03@inspur.com>

Acked-by: Jason Wang <jasowang@redhat.com>

> ---
>  drivers/virtio/virtio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index 7deeed30d1f3..ddd4466da83b 100644
> --- a/drivers/virtio/virtio.c
> +++ b/drivers/virtio/virtio.c
> @@ -428,7 +428,9 @@ int register_virtio_device(struct virtio_device *dev)
>                 goto out;
>
>         dev->index = err;
> -       dev_set_name(&dev->dev, "virtio%u", dev->index);
> +       err = dev_set_name(&dev->dev, "virtio%u", dev->index);
> +       if (err)
> +               goto out_ida_remove;
>
>         err = virtio_device_of_init(dev);
>         if (err)
> --
> 2.27.0
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2022-07-08  6:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  3:17 [PATCH] virtio: Check dev_set_name() return value Bo Liu
2022-07-08  6:00 ` Jason Wang [this message]
2022-07-08  6:00   ` Jason Wang

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='CACGkMEujMgP=QbQte6Hjv2DXp7TYJXQvu8uK3=h130pcr6eYsg@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubo03@inspur.com \
    --cc=mst@redhat.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: link
Be 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.