In the Linux kernel, the following vulnerability has been resolved:
clk: Fix clkhwget_clk() when dev is NULL
Any registered clkcore structure can have a NULL pointer in its dev field. While never actually documented, this is evidenced by the wide usage of clkregister and clkhwregister with a NULL device pointer, and the fact that the core ofclkhw_register() function also passes a NULL device pointer.
A call to clkhwgetclk() on a clkhw struct whose clkcore is in that case will result in a NULL pointer derefence when it calls devname() on that NULL device pointer.
Add a test for this case and use NULL as the dev_id if the device pointer is NULL.