OSDN Git Service

[media] rtl28xxu: fix return value check in rtl2832u_tuner_attach()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 16 Apr 2015 12:22:46 +0000 (09:22 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 12 May 2015 16:27:22 +0000 (13:27 -0300)
In case of error, the function platform_device_register_data() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/dvb-usb-v2/rtl28xxu.c

index 616be99..bcd7e0f 100644 (file)
@@ -1293,7 +1293,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
                                                     "rtl2832_sdr",
                                                     PLATFORM_DEVID_AUTO,
                                                     &pdata, sizeof(pdata));
-               if (pdev == NULL || pdev->dev.driver == NULL)
+               if (IS_ERR(pdev) || pdev->dev.driver == NULL)
                        break;
                dev->platform_device_sdr = pdev;
                break;