lkml.org 
[lkml]   [2022]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ipack: Check dev_set_name() return value
From
Date
Hi Bo,

Thanks for your contribution!

Patch is,

Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>

Greg, Would you mind picking this patch series through your char-misc
tree?

Thanks!

Sam

On Fri, 2022-08-05 at 05:10 -0400, Bo Liu wrote:
> It's possible that dev_set_name() returns -ENOMEM, catch and handle
> this.
>
> Signed-off-by: Bo Liu <liubo03@inspur.com>
> ---
>  drivers/ipack/ipack.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c
> index b1c3198355e7..74d449858a61 100644
> --- a/drivers/ipack/ipack.c
> +++ b/drivers/ipack/ipack.c
> @@ -429,8 +429,11 @@ int ipack_device_init(struct ipack_device *dev)
>         dev->dev.bus = &ipack_bus_type;
>         dev->dev.release = ipack_device_release;
>         dev->dev.parent = dev->bus->parent;
> -       dev_set_name(&dev->dev,
> +       ret = dev_set_name(&dev->dev,
>                      "ipack-dev.%u.%u", dev->bus->bus_nr, dev->slot);
> +       if (ret)
> +               return ret;
> +
>         device_initialize(&dev->dev);
>  
>         if (dev->bus->ops->set_clockrate(dev, 8))

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-08-31 13:02    [W:0.057 / U:1.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site