* Coverity: vgxy61_apply_gpiox_strobe_mode(): Control flow issues
@ 2022-11-10 16:31 coverity-bot
0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2022-11-10 16:31 UTC (permalink / raw)
To: Benjamin Mugnier
Cc: linux-kernel, Sakari Ailus, Jean-Michel Hautbois, Shawn Tu,
linux-media, Sylvain Petinot, Laurent Pinchart, Hans Verkuil,
Mauro Carvalho Chehab, Gustavo A. R. Silva, linux-next,
linux-hardening
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20221110 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan
You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:
Thu Oct 27 14:37:38 2022 +0300
153e4ad44d60 ("media: i2c: Add driver for ST VGXY61 camera sensor")
Coverity reported the following:
*** CID 1527249: Control flow issues (NO_EFFECT)
drivers/media/i2c/st-vgxy61.c:891 in vgxy61_apply_gpiox_strobe_mode()
885 unsigned int idx)
886 {
887 static const u8 index2val[] = {0x0, 0x1, 0x3};
888 u16 reg;
889
890 reg = vgxy61_read_reg(sensor, VGXY61_REG_SIGNALS_CTRL);
vvv CID 1527249: Control flow issues (NO_EFFECT)
vvv This less-than-zero comparison of an unsigned value is never true. "reg < 0".
891 if (reg < 0)
892 return reg;
893 reg &= ~(0xf << (idx * VGXY61_SIGNALS_GPIO_ID_SHIFT));
894 reg |= index2val[mode] << (idx * VGXY61_SIGNALS_GPIO_ID_SHIFT);
895
896 return vgxy61_write_reg(sensor, VGXY61_REG_SIGNALS_CTRL, reg, NULL);
If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527249 ("Control flow issues")
Fixes: 153e4ad44d60 ("media: i2c: Add driver for ST VGXY61 camera sensor")
Thanks for your attention!
--
Coverity-bot
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-10 16:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-10 16:31 Coverity: vgxy61_apply_gpiox_strobe_mode(): Control flow issues coverity-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).