1 From 7104c55664bae574b77e442520513abdff90d278 Mon Sep 17 00:00:00 2001
2 From: Nathan Chancellor <nathan@kernel.org>
3 Date: Mon, 31 Jan 2022 17:23:38 -0700
4 Subject: [PATCH] media: bcm2835-unicam: Set ret on error path in
5 unicam_async_complete()
9 drivers/media/platform/bcm2835/bcm2835-unicam.c:3109:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
12 drivers/media/platform/bcm2835/bcm2835-unicam.c:3152:9: note: uninitialized use occurs here
15 drivers/media/platform/bcm2835/bcm2835-unicam.c:3109:2: note: remove the 'if' if its condition is always false
18 drivers/media/platform/bcm2835/bcm2835-unicam.c:3091:9: note: initialize the variable 'ret' to silence this warning
24 When the if condition is true, ret will be used uninitialized, which
25 could result in undesirable behavior. Set ret to -ENODEV on the error
26 path, which is a standard error code for the ->complete() callback.
28 Fixes: d056e86eb35f ("media/bcm2835-unicam: Parse pad numbers correctly")
29 Signed-off-by: Nathan Chancellor <nathan@kernel.org>
31 drivers/media/platform/bcm2835/bcm2835-unicam.c | 1 +
32 1 file changed, 1 insertion(+)
34 --- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
35 +++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
36 @@ -3108,6 +3108,7 @@ static int unicam_async_complete(struct
39 unicam_err(unicam, "No source pads on sensor.\n");