Skip to content

Commit f83bd49

Browse files
Yan Leimchehab
authored andcommitted
media: v4l2: fix uninitialized value tuner_status(CWE-457)
Declaring variable "tuner_status" without initializer. Using uninitialized value "tuner_status" when calling "*fe_tuner_ops->get_status". (The function pointer resolves to "cx24113_get_status".) Signed-off-by: Yan Lei <yan_lei@dahuatech.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 03b49ec commit f83bd49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/v4l2-core/tuner-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ static void tuner_status(struct dvb_frontend *fe)
11181118
if (t->mode != V4L2_TUNER_RADIO)
11191119
return;
11201120
if (fe_tuner_ops->get_status) {
1121-
u32 tuner_status;
1121+
u32 tuner_status = 0;
11221122

11231123
fe_tuner_ops->get_status(&t->fe, &tuner_status);
11241124
if (tuner_status & TUNER_STATUS_LOCKED)
@@ -1258,7 +1258,7 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
12581258
if (vt->type == t->mode) {
12591259
vt->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
12601260
if (fe_tuner_ops->get_status) {
1261-
u32 tuner_status;
1261+
u32 tuner_status = 0;
12621262

12631263
fe_tuner_ops->get_status(&t->fe, &tuner_status);
12641264
vt->rxsubchans =

0 commit comments

Comments
 (0)