* [PATCH] media: dvb_frontend: Fix uninitialized error in dvb_frontend_handle_ioctl()
@ 2017-11-16 10:51 Geert Uytterhoeven
2017-11-16 11:38 ` Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2017-11-16 10:51 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Shuah Khan
Cc: Arnd Bergmann, linux-media, linux-kernel, Geert Uytterhoeven
With gcc-4.1.2:
drivers/media/dvb-core/dvb_frontend.c: In function ‘dvb_frontend_handle_ioctl’:
drivers/media/dvb-core/dvb_frontend.c:2110: warning: ‘err’ may be used uninitialized in this function
Indeed, there are 13 cases where err is used initialized if one of the
dvb_frontend_ops is not implemented.
Preinitialize err to -EOPNOTSUPP like before to fix this.
Fixes: d73dcf0cdb95a47f ("media: dvb_frontend: cleanup ioctl handling logic")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/media/dvb-core/dvb_frontend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 3ad83359098bde79..9eff8ce60d535379 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2107,7 +2107,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
struct dvb_frontend *fe = dvbdev->priv;
struct dvb_frontend_private *fepriv = fe->frontend_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
- int i, err;
+ int i, err = -ENOTSUPP;
dev_dbg(fe->dvb->device, "%s:\n", __func__);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: dvb_frontend: Fix uninitialized error in dvb_frontend_handle_ioctl()
2017-11-16 10:51 [PATCH] media: dvb_frontend: Fix uninitialized error in dvb_frontend_handle_ioctl() Geert Uytterhoeven
@ 2017-11-16 11:38 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2017-11-16 11:38 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Mauro Carvalho Chehab, Shuah Khan, Linux Media Mailing List,
Linux Kernel Mailing List
On Thu, Nov 16, 2017 at 11:51 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> With gcc-4.1.2:
>
> drivers/media/dvb-core/dvb_frontend.c: In function ‘dvb_frontend_handle_ioctl’:
> drivers/media/dvb-core/dvb_frontend.c:2110: warning: ‘err’ may be used uninitialized in this function
>
> Indeed, there are 13 cases where err is used initialized if one of the
> dvb_frontend_ops is not implemented.
>
> Preinitialize err to -EOPNOTSUPP like before to fix this.
>
> Fixes: d73dcf0cdb95a47f ("media: dvb_frontend: cleanup ioctl handling logic")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Good catch!
This one shows up on x86 allmdoconfig with gcc-4.5 or older but not gcc-4.6.
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-16 11:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 10:51 [PATCH] media: dvb_frontend: Fix uninitialized error in dvb_frontend_handle_ioctl() Geert Uytterhoeven
2017-11-16 11:38 ` Arnd Bergmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.