From: Syam Sidhardhan Date: Sun, 24 Feb 2013 21:47:18 +0000 (-0300) Subject: [media] lmedm04: Fix possible NULL pointer dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=06f950f43f29eb0b5631c6d037d78319649ac3b0;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [media] lmedm04: Fix possible NULL pointer dereference Check for (adap == NULL) has to done before accessing adap. Signed-off-by: Syam Sidhardhan Signed-off-by: Mauro Carvalho Chehab --- 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, struct usb_data_stream_properties *stream) { struct dvb_usb_adapter *adap = fe_to_adap(fe); - struct dvb_usb_device *d = adap_to_d(adap); + struct dvb_usb_device *d; if (adap == NULL) return 0; + + d = adap_to_d(adap); + /* Turn PID filter on the fly by module option */ if (pid_filter == 2) { adap->pid_filtering = 1;