diff options
author | Syam Sidhardhan <syamsidhardh@gmail.com> | 2013-02-24 16:47:18 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-18 15:34:15 -0400 |
commit | 06f950f43f29eb0b5631c6d037d78319649ac3b0 (patch) | |
tree | 1bb7f1c2b0f6b28090df5992476157f8fd3c4fc2 | |
parent | 4d35435d3ffb853b491f5bb21a62529cd925d660 (diff) |
[media] lmedm04: Fix possible NULL pointer dereference
Check for (adap == NULL) has to done before accessing adap.
Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/lmedm04.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c index f30c58cecbba..96804be0fffe 100644 --- a/drivers/media/usb/dvb-usb-v2/lmedm04.c +++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c | |||
@@ -1241,10 +1241,13 @@ static int lme2510_get_stream_config(struct dvb_frontend *fe, u8 *ts_type, | |||
1241 | struct usb_data_stream_properties *stream) | 1241 | struct usb_data_stream_properties *stream) |
1242 | { | 1242 | { |
1243 | struct dvb_usb_adapter *adap = fe_to_adap(fe); | 1243 | struct dvb_usb_adapter *adap = fe_to_adap(fe); |
1244 | struct dvb_usb_device *d = adap_to_d(adap); | 1244 | struct dvb_usb_device *d; |
1245 | 1245 | ||
1246 | if (adap == NULL) | 1246 | if (adap == NULL) |
1247 | return 0; | 1247 | return 0; |
1248 | |||
1249 | d = adap_to_d(adap); | ||
1250 | |||
1248 | /* Turn PID filter on the fly by module option */ | 1251 | /* Turn PID filter on the fly by module option */ |
1249 | if (pid_filter == 2) { | 1252 | if (pid_filter == 2) { |
1250 | adap->pid_filtering = 1; | 1253 | adap->pid_filtering = 1; |