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

Wolfram Sang wsa at kernel.org
Sat Feb 3 23:44:40 MSK 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://linuxtesting.org/pipermail/lvc-project/attachments/20240203/dcd626c3/attachment.pgp>


More information about the lvc-project mailing list