02723056cfd79821d73c02398c446a4d8ced542c
[openwrt/staging/jogo.git] /
1 From f07147faddeb0e99bfe181af78fcda9ea7f06c3d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Mon, 8 Oct 2018 18:26:15 +0100
4 Subject: [PATCH] staging: bcm2835-camera: Correct
5 V4L2_CID_COLORFX_CBCR behaviour
6
7 With V4L2_CID_COLORFX_CBCR calling ctrl_set_colfx it was incorrectly
8 assigning the colour values to the enable field of dev->colourfx
9 instead of the u and v fields.
10
11 Correct the assignments.
12
13 Reported as a Coverity issue
14 Detected by CoverityScan CID#1419711 ("Unused value")
15
16 Reported-by: Colin Ian King <colin.king@canonical.com>
17 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
18 ---
19 drivers/staging/vc04_services/bcm2835-camera/controls.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
23 +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
24 @@ -578,8 +578,8 @@ static int ctrl_set_colfx(struct bm2835_
25
26 control = &dev->component[COMP_CAMERA]->control;
27
28 - dev->colourfx.enable = (ctrl->val & 0xff00) >> 8;
29 - dev->colourfx.enable = ctrl->val & 0xff;
30 + dev->colourfx.u = (ctrl->val & 0xff00) >> 8;
31 + dev->colourfx.v = ctrl->val & 0xff;
32
33 ret = vchiq_mmal_port_parameter_set(dev->instance, control,
34 MMAL_PARAMETER_COLOUR_EFFECT,