Commit a9cb97c3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: dvb_frontend: be sure to init dvb_frontend_handle_ioctl() return code

As smatch warned:
	drivers/media/dvb-core/dvb_frontend.c:2468 dvb_frontend_handle_ioctl() error: uninitialized symbol 'err'.

The ioctl handler actually got a regression here: before changeset
d73dcf0c ("media: dvb_frontend: cleanup ioctl handling logic"),
the code used to return -EOPNOTSUPP if an ioctl handler was not
implemented on a driver. After the change, it may return a random
value.

Fixes: d73dcf0c ("media: dvb_frontend: cleanup ioctl handling logic")

Cc: stable@vger.kernel.org
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Tested-by: default avatarDaniel Scheller <d.scheller@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 7621b8c4
...@@ -2110,7 +2110,7 @@ static int dvb_frontend_handle_ioctl(struct file *file, ...@@ -2110,7 +2110,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
struct dvb_frontend *fe = dvbdev->priv; struct dvb_frontend *fe = dvbdev->priv;
struct dvb_frontend_private *fepriv = fe->frontend_priv; struct dvb_frontend_private *fepriv = fe->frontend_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int i, err; int i, err = -EOPNOTSUPP;
dev_dbg(fe->dvb->device, "%s:\n", __func__); dev_dbg(fe->dvb->device, "%s:\n", __func__);
...@@ -2145,6 +2145,7 @@ static int dvb_frontend_handle_ioctl(struct file *file, ...@@ -2145,6 +2145,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
} }
} }
kfree(tvp); kfree(tvp);
err = 0;
break; break;
} }
case FE_GET_PROPERTY: { case FE_GET_PROPERTY: {
...@@ -2196,6 +2197,7 @@ static int dvb_frontend_handle_ioctl(struct file *file, ...@@ -2196,6 +2197,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
return -EFAULT; return -EFAULT;
} }
kfree(tvp); kfree(tvp);
err = 0;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment