Re: [PATCH] kobject: fix kobj and fmt are both null

From: Greg KH
Date: Sun Sep 03 2023 - 09:37:39 EST


On Sun, Sep 03, 2023 at 08:42:31PM +0800, Edward AD wrote:
> If kobj and fmt are both NULL, it will cause an exception in kvasprintf_const,
> then when this situation occurs, -EINVAL is directly returned.

How can this happen? Are there any in-kernel users that cause this to
occur?

If so, which ones, why not fix that?

And your description isn't quite correct here, you are not checking for
kobj, but rather kobj->name.

thanks,

greg k-h