[PATCH] drm/arm/komeda: Add a condition check before removing sysfs attribute

Maxime Ripard mripard at kernel.org
Thu Feb 20 09:43:23 UTC 2025


On Thu, Feb 20, 2025 at 05:20:48PM +0800, Shixiong Ou wrote:
> 
> 在 2025/2/20 17:12, Maxime Ripard 写道:
> > On Thu, Feb 20, 2025 at 04:53:58PM +0800,oushixiong1025 at 163.com  wrote:
> > > From: Shixiong Ou<oushixiong at kylinos.cn>
> > > 
> > > [WHY] If the call to sysfs_create_group() fails, there is
> > >        no need to call function sysfs_remove_group().
> > > 
> > > [HOW] Add a condition check before removing sysfs attribute.
> > > 
> > > Signed-off-by: Shixiong Ou<oushixiong at kylinos.cn>
> > What are you trying to fix exactly? AFAIK, there's no code path that
> > calls komeda_dev_destroy() after komeda_dev_create() has failed.
>
> |if calling |||sysfs_create_group() fails, it will go to lable
> 'err_cleanup:', and it will call |komeda_dev_destroy() laterly.

Ah, right. Then that's what you should fix.

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20250220/1bcc441e/attachment.sig>


More information about the dri-devel mailing list