Skip to content

Commit

Permalink
[media] staging: easycap: Initialize 'ntsc' parameter before usage
Browse files Browse the repository at this point in the history
This parameter is now initialized at init_easycap(),
this way we assure it won't be used uninitialized.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Ezequiel García authored and Mauro Carvalho Chehab committed May 15, 2012
1 parent f9482d0 commit 751869e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/media/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2960,6 +2960,10 @@ static void init_easycap(struct easycap *peasycap,
peasycap->audio_isoc_buffer_size = -1;

peasycap->frame_buffer_many = FRAME_BUFFER_MANY;

peasycap->ntsc = easycap_ntsc;
JOM(8, "defaulting initially to %s\n",
easycap_ntsc ? "NTSC" : "PAL");
}

static int populate_inputset(struct easycap *peasycap)
Expand All @@ -2972,7 +2976,6 @@ static int populate_inputset(struct easycap *peasycap)

inputset = peasycap->inputset;

/* FIXME: peasycap->ntsc is not yet initialized */
fmtidx = peasycap->ntsc ? NTSC_M : PAL_BGHIN;

m = 0;
Expand Down Expand Up @@ -3650,9 +3653,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
* because some udev rules triggers easycap_open()
* immediately after registration, causing a clash.
*/
peasycap->ntsc = easycap_ntsc;
JOM(8, "defaulting initially to %s\n",
easycap_ntsc ? "NTSC" : "PAL");
rc = reset(peasycap);
if (rc) {
SAM("ERROR: reset() rc = %i\n", rc);
Expand Down

0 comments on commit 751869e

Please sign in to comment.