[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230615164452.GA1166619-robh@kernel.org>
Date: Thu, 15 Jun 2023 10:44:52 -0600
From: Rob Herring <robh@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Frank Rowand <frowand.list@...il.com>
Subject: Re: [PATCH v1 1/1] of/platform: Propagate firmware node by calling
device_set_node()
On Thu, Jun 15, 2023 at 06:03:52PM +0300, Andy Shevchenko wrote:
> On Thu, Jun 15, 2023 at 06:01:17PM +0300, Andy Shevchenko wrote:
> > On Thu, Jun 15, 2023 at 05:59:52PM +0300, Andy Shevchenko wrote:
> > > On Thu, Jun 15, 2023 at 05:52:43PM +0300, Andy Shevchenko wrote:
> > > > Insulate of_device_alloc() and of_amba_device_create() from possible
> > > > changes to fwnode_handle implementation by using device_set_node()
> > > > instead of open-coding dev->dev.fwnode assignments.
> > >
> > > Side note. When I preparing this change I have noticed a lot of
> > >
> > > dev_set_name(... dev_name())
> >
> > Plus
> >
> > dev_set_name(dev, ...)
> > ...
> > dev_set_name(dev, ...)
> >
> > on the same device will also give a memory leak.
>
> Ah, seems false alarm, the kobject_set_name_vargs() frees the old one.
> Sorry for the noise for second point. But the first one still applies.
>
> > > in the code which seems to me problematic in two ways:
> > > 1) (minor) the dev_set_name() may fail, no checks are there;
Is there anything besides a memory alloc failure? What will print a
message already. Wouldn't we fail a bit later on when adding the
device anyways?
In a rough count, 92 out of 500 cases check the return of
dev_set_name().
Rob
Powered by blists - more mailing lists