summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2024-05-09 17:05:55 +0000
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-06-04 08:31:22 +0200
commit984abe0b5794a2aca359bb61555351d2ec520d2a (patch)
treea8e8be6733ebd8a3b3aea76ccfe81bfc4168dfc5
parenta1956bf53a2774014ee1768b484af2c38c633a25 (diff)
media: i2c: hi846: Fix V4L2_SUBDEV_FORMAT_TRY get_selection()
The current code does not return anything to the user. Although the code looks a bit dangerous (using a pointer without checking if it is valid), it should be fine. The core validates that sel->pad has a valid value. Fix the following smatch error: drivers/media/i2c/hi846.c:1854 hi846_get_selection() warn: statement has no effect 31 Fixes: e8c0882685f9 ("media: i2c: add driver for the SK Hynix Hi-846 8M pixel camera") Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Sakari Ailus: code -> core.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/i2c/hi846.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c
index 9c565ec033d4..52d9ca68a86c 100644
--- a/drivers/media/i2c/hi846.c
+++ b/drivers/media/i2c/hi846.c
@@ -1851,7 +1851,7 @@ static int hi846_get_selection(struct v4l2_subdev *sd,
mutex_lock(&hi846->mutex);
switch (sel->which) {
case V4L2_SUBDEV_FORMAT_TRY:
- v4l2_subdev_state_get_crop(sd_state, sel->pad);
+ sel->r = *v4l2_subdev_state_get_crop(sd_state, sel->pad);
break;
case V4L2_SUBDEV_FORMAT_ACTIVE:
sel->r = hi846->cur_mode->crop;