Re: [PATCH] i2c: smbus: fix NULL function pointer dereference

Jean Delvare
2024-06-05T09:21:01Z

Hi Wolfram,

On Tue, 4 Jun 2024 22:08:41 +0200, Wolfram Sang wrote:
> > > gracefully because kicking off I2C transfers is not a hot path. Maybe we
> > > could turn the dev_dbg into something louder to make people aware that
> > > there is a bug?
> >
> > My previous message initially had a suggestion in that direction ;-)
> > but I first wanted your opinion on the check itself. dev_dbg() is
> > definitely not appropriate for a condition which should never happen
> > and implies there's a bug somewhere else. A WARN_ON_ONCE would probably
> > be better, so that the bug gets spotted and fixed quickly.
>
> So, are you okay with keeping the check where it is now and turning the
> dev_dbg into WARN_ON_ONCE? I am.

Yes I am.

Thanks,
--
Jean Delvare
SUSE L3 Support