* [PATCH] [media] rainshadow-cec: ensure exit_loop is initialized
@ 2017-05-19 17:39 Colin King
2017-05-19 17:43 ` NACK: " Colin Ian King
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-05-19 17:39 UTC (permalink / raw)
To: Arnd Bergmann, Eric Anholt, David Airlie, Hans Verkuil,
Mauro Carvalho Chehab, dri-devel, linux-media
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
exit_loop is not being initialized, so it contains garbage. Ensure it is
initialized to false.
Detected by CoverityScan, CID#1436409 ("Uninitialzed scalar variable")
Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized warning")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/vc4/vc4_v3d.c | 2 +-
drivers/media/usb/rainshadow-cec/rainshadow-cec.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index c53afec34586..c42210203f6e 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -218,7 +218,7 @@ int vc4_v3d_get_bin_slot(struct vc4_dev *vc4)
* overall CMA pool before they make scenes complicated enough to run
* out of bin space.
*/
-int
+static int
vc4_allocate_bin_bo(struct drm_device *drm)
{
struct vc4_dev *vc4 = to_vc4_dev(drm);
diff --git a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
index 8d3ca2c8b20f..ad468efc4399 100644
--- a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
+++ b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
@@ -119,7 +119,7 @@ static void rain_irq_work_handler(struct work_struct *work)
while (true) {
unsigned long flags;
- bool exit_loop;
+ bool exit_loop = false;
char data;
spin_lock_irqsave(&rain->buf_lock, flags);
--
2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread* NACK: [PATCH] [media] rainshadow-cec: ensure exit_loop is initialized
2017-05-19 17:39 [PATCH] [media] rainshadow-cec: ensure exit_loop is initialized Colin King
@ 2017-05-19 17:43 ` Colin Ian King
0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2017-05-19 17:43 UTC (permalink / raw)
To: Arnd Bergmann, Eric Anholt, David Airlie, Hans Verkuil,
Mauro Carvalho Chehab, dri-devel, linux-media
Cc: kernel-janitors, linux-kernel
On 19/05/17 18:39, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> exit_loop is not being initialized, so it contains garbage. Ensure it is
> initialized to false.
>
> Detected by CoverityScan, CID#1436409 ("Uninitialzed scalar variable")
>
> Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized warning")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/gpu/drm/vc4/vc4_v3d.c | 2 +-
> drivers/media/usb/rainshadow-cec/rainshadow-cec.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
> index c53afec34586..c42210203f6e 100644
> --- a/drivers/gpu/drm/vc4/vc4_v3d.c
> +++ b/drivers/gpu/drm/vc4/vc4_v3d.c
> @@ -218,7 +218,7 @@ int vc4_v3d_get_bin_slot(struct vc4_dev *vc4)
> * overall CMA pool before they make scenes complicated enough to run
> * out of bin space.
> */
> -int
> +static int
> vc4_allocate_bin_bo(struct drm_device *drm)
> {
> struct vc4_dev *vc4 = to_vc4_dev(drm);
> diff --git a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
> index 8d3ca2c8b20f..ad468efc4399 100644
> --- a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
> +++ b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
> @@ -119,7 +119,7 @@ static void rain_irq_work_handler(struct work_struct *work)
>
> while (true) {
> unsigned long flags;
> - bool exit_loop;
> + bool exit_loop = false;
> char data;
>
> spin_lock_irqsave(&rain->buf_lock, flags);
>
Sorry, got another fix included into that. I'll re-submit
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-19 17:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 17:39 [PATCH] [media] rainshadow-cec: ensure exit_loop is initialized Colin King
2017-05-19 17:43 ` NACK: " Colin Ian King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®