[PATCH] i2c: Remove redundant comparison in npcm_i2c_reg_slave

Wolfram Sang wsa at kernel.org
Wed Feb 7 06:52:06 AEDT 2024


On Tue, Feb 06, 2024 at 10:42:01PM +0300, Rand Deeb wrote:
> In the npcm_i2c_reg_slave() function, there was a redundant
> comparison that checked if 'bus->slave' was null immediately after
> assigning it the 'client' value. There were concerns about a
> potential null dereference because of `client->adapter`, but
> according to Wolfram Sang, "we trusted ourselves here" Therefore,
> this comparison is unnecessary.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Rand Deeb <rand.sec96 at gmail.com>

Reviewed-by: Wolfram Sang <wsa+renesas at sang-engineering.com>

-------------- 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/20240206/40f94888/attachment.sig>


More information about the openbmc mailing list