From: Ezequiel GarcĂ­a Date: Fri, 24 Feb 2012 14:24:17 +0000 (-0300) Subject: [media] staging: easycap: Initialize 'ntsc' parameter before usage X-Git-Tag: firefly_0821_release~3680^2~275^2~2195 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=751869e6ef489e33c66a254fa004c92e76ef1a43;p=firefly-linux-kernel-4.4.55.git [media] staging: easycap: Initialize 'ntsc' parameter before usage This parameter is now initialized at init_easycap(), this way we assure it won't be used uninitialized. Signed-off-by: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/easycap/easycap_main.c b/drivers/staging/media/easycap/easycap_main.c index 9d6dc09656be..480164d8698c 100644 --- a/drivers/staging/media/easycap/easycap_main.c +++ b/drivers/staging/media/easycap/easycap_main.c @@ -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) @@ -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; @@ -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);