Re: [PATCH] driver: core: Prevent NULL pointer dereference in device name functions

From: Greg Kroah-Hartman
Date: Mon Feb 13 2023 - 02:16:14 EST


On Mon, Feb 13, 2023 at 08:12:08AM +0100, Alexander Sverdlin wrote:
> Hi Greg,
>
> On Mon, 2023-02-13 at 08:07 +0100, Greg Kroah-Hartman wrote:
> > > Prevent similar scenarios:
> > >
> > > Unable to handle kernel NULL pointer dereference at virtual address 00000038
> > > ...
> > > PC is at dev_driver_string+0x0/0x38
> >
> > How did this "scenario" happen?  What in-tree code caused this?
> >
>
> such in-tree code is not known to me, I stubled upon this putting dev_info()
> all over the code in the platform we currently convert to DT (cirrus ep93xx).

Instead of using dev_info() for tracing, use ftrace instead, that's what
it is there for! :)

thanks,

greg k-h