[PATCH] media: dvb_frontend: Fix uninitialized error in dvb_frontend_handle_ioctl()
From: Geert Uytterhoeven
Date: Thu Nov 16 2017 - 05:51:37 EST
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@xxxxxxxxxxxxxx>
---
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