Skip to content

Commit

Permalink
V4L/DVB (11334): pvrusb2: Fix uninitialized tuner_setup field(s)
Browse files Browse the repository at this point in the history
Any time a struct (especially one not defined by this driver) is
allocated, we MUST zero its underlying storage.  This makes our usage
of the struct predictable and robust against future changes where
fields might be added that we don't know about.  Failing to do this
with tuner_setup left the config field uninitialized which then caused
trouble with the tuner type used for HVR-1950 devices.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Apr 7, 2009
1 parent 7bf56f9 commit fcd62cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/video/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2926,6 +2926,7 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw)
pvr2_trace(PVR2_TRACE_CHIPS, "subdev tuner set_type(%d)",
hdw->tuner_type);
if (((int)(hdw->tuner_type)) >= 0) {
memset(&setup, 0, sizeof(setup));
setup.addr = ADDR_UNSET;
setup.type = hdw->tuner_type;
setup.mode_mask = T_RADIO | T_ANALOG_TV;
Expand Down

0 comments on commit fcd62cf

Please sign in to comment.