[lvc-project] [PATCH] i2c: Fix NULL pointer dereference in npcm_i2c_reg_slave

Wolfram Sang wsa at kernel.org
Sun Feb 4 07:44:40 AEDT 2024


> If I'm not missing something, npcm_i2c_reg_slave() is called via a
> function pointer ->reg_slave here [1]. And seems `client` can't be NULL
> there. Other drivers implementing ->reg_slave function don't check its
> argument.

Correct, we trust ourselves here.

> Maybe we should just drop `if (!bus->slave)` check?

Yes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20240203/dcd626c3/attachment.sig>


More information about the openbmc mailing list