[media] rtl28xxu: properly initialize pdata
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 3 Feb 2015 18:36:28 +0000 (16:36 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 3 Feb 2015 18:38:48 +0000 (16:38 -0200)
As complained by smatch:
drivers/media/usb/dvb-usb-v2/rtl28xxu.c:1159 rtl2832u_tuner_attach() info: 'pdata' is not actually initialized (unreached code).

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

index d88f7994bc7cc31a8fdf0b8416ae7e2e4e75f587..77dcfdf547ac8f62e4cc2ea5a8fa086478e545b5 100644 (file)
@@ -1055,10 +1055,13 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
        struct i2c_board_info info;
        struct i2c_client *client;
        struct v4l2_subdev *subdev = NULL;
+       struct platform_device *pdev;
+       struct rtl2832_sdr_platform_data pdata;
 
        dev_dbg(&d->intf->dev, "\n");
 
        memset(&info, 0, sizeof(struct i2c_board_info));
+       memset(&pdata, 0, sizeof(pdata));
 
        switch (dev->tuner) {
        case TUNER_RTL2832_FC0012:
@@ -1155,9 +1158,6 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
 
        /* register SDR */
        switch (dev->tuner) {
-               struct platform_device *pdev;
-               struct rtl2832_sdr_platform_data pdata = {};
-
        case TUNER_RTL2832_FC0012:
        case TUNER_RTL2832_FC0013:
        case TUNER_RTL2832_E4000: