This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: v4l2-flash-led-class: drop an useless check
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Mon Jun 21 08:54:41 2021 +0200

As pointed by smatch:
        drivers/media/v4l2-core/v4l2-flash-led-class.c:264 v4l2_flash_s_ctrl() 
error: we previously assumed 'fled_cdev' could be null (see line 197)

It is too late to check if fled_cdev is NULL there. If such check is
needed, it should be, instead, inside v4l2_flash_init().

On other words, if v4l2_flash->fled_cdev() is NULL at
v4l2_flash_s_ctrl(), all led_*() function calls inside the function
would try to de-reference a NULL pointer, as the logic won't prevent
it.

So, remove the useless check.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/v4l2-core/v4l2-flash-led-class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---

diff --git a/drivers/media/v4l2-core/v4l2-flash-led-class.c 
b/drivers/media/v4l2-core/v4l2-flash-led-class.c
index 10ddcc48aa17..a1653c635d82 100644
--- a/drivers/media/v4l2-core/v4l2-flash-led-class.c
+++ b/drivers/media/v4l2-core/v4l2-flash-led-class.c
@@ -194,7 +194,7 @@ static int v4l2_flash_s_ctrl(struct v4l2_ctrl *c)
 {
        struct v4l2_flash *v4l2_flash = v4l2_ctrl_to_v4l2_flash(c);
        struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev;
-       struct led_classdev *led_cdev = fled_cdev ? &fled_cdev->led_cdev : NULL;
+       struct led_classdev *led_cdev = &fled_cdev->led_cdev;
        struct v4l2_ctrl **ctrls = v4l2_flash->ctrls;
        bool external_strobe;
        int ret = 0;

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to