瀏覽代碼

[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>
Syam Sidhardhan 12 年之前
父節點
當前提交
06f950f43f
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      drivers/media/usb/dvb-usb-v2/lmedm04.c

+ 4 - 1
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;