[usb:usb-next 4/10] drivers/usb/misc/usb3503.c:238 usb3503_probe() error: we previously assumed 'pdata' could be null (see line 196)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dongjin,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next
head:   f8be6bfc5da027952e827a503e747fde5393adcc
commit: 6a099c63650e50ebf7d1259b859a3d230aec4207 [4/10] USB: misc: Add USB3503 High-Speed Hub Controller

drivers/usb/misc/usb3503.c:238 usb3503_probe() error: we previously assumed 'pdata' could be null (see line 196)

vim +/pdata +238 drivers/usb/misc/usb3503.c

6a099c63 Dongjin Kim 2012-12-08  190  		return -ENOMEM;
6a099c63 Dongjin Kim 2012-12-08  191  	}
6a099c63 Dongjin Kim 2012-12-08  192  
6a099c63 Dongjin Kim 2012-12-08  193  	i2c_set_clientdata(i2c, hub);
6a099c63 Dongjin Kim 2012-12-08  194  	hub->client = i2c;
6a099c63 Dongjin Kim 2012-12-08  195  
6a099c63 Dongjin Kim 2012-12-08 @196  	if (!pdata) {
6a099c63 Dongjin Kim 2012-12-08  197  		dev_dbg(&i2c->dev, "missing platform data\n");
6a099c63 Dongjin Kim 2012-12-08  198  	} else {
6a099c63 Dongjin Kim 2012-12-08  199  		hub->gpio_intn		= pdata->gpio_intn;
6a099c63 Dongjin Kim 2012-12-08  200  		hub->gpio_connect	= pdata->gpio_connect;
6a099c63 Dongjin Kim 2012-12-08  201  		hub->gpio_reset		= pdata->gpio_reset;
6a099c63 Dongjin Kim 2012-12-08  202  		hub->mode		= pdata->initial_mode;
6a099c63 Dongjin Kim 2012-12-08  203  	}
6a099c63 Dongjin Kim 2012-12-08  204  
6a099c63 Dongjin Kim 2012-12-08  205  	if (gpio_is_valid(hub->gpio_intn)) {
6a099c63 Dongjin Kim 2012-12-08  206  		err = gpio_request_one(hub->gpio_intn,
6a099c63 Dongjin Kim 2012-12-08  207  				GPIOF_OUT_INIT_HIGH, "usb3503 intn");
6a099c63 Dongjin Kim 2012-12-08  208  		if (err) {
6a099c63 Dongjin Kim 2012-12-08  209  			dev_err(&i2c->dev,
6a099c63 Dongjin Kim 2012-12-08  210  					"unable to request GPIO %d as connect pin (%d)\n",
6a099c63 Dongjin Kim 2012-12-08  211  					hub->gpio_intn, err);
6a099c63 Dongjin Kim 2012-12-08  212  			goto err_gpio_intn;
6a099c63 Dongjin Kim 2012-12-08  213  		}
6a099c63 Dongjin Kim 2012-12-08  214  	}
6a099c63 Dongjin Kim 2012-12-08  215  
6a099c63 Dongjin Kim 2012-12-08  216  	if (gpio_is_valid(hub->gpio_connect)) {
6a099c63 Dongjin Kim 2012-12-08  217  		err = gpio_request_one(hub->gpio_connect,
6a099c63 Dongjin Kim 2012-12-08  218  				GPIOF_OUT_INIT_HIGH, "usb3503 connect");
6a099c63 Dongjin Kim 2012-12-08  219  		if (err) {
6a099c63 Dongjin Kim 2012-12-08  220  			dev_err(&i2c->dev,
6a099c63 Dongjin Kim 2012-12-08  221  					"unable to request GPIO %d as connect pin (%d)\n",
6a099c63 Dongjin Kim 2012-12-08  222  					hub->gpio_connect, err);
6a099c63 Dongjin Kim 2012-12-08  223  			goto err_gpio_connect;
6a099c63 Dongjin Kim 2012-12-08  224  		}
6a099c63 Dongjin Kim 2012-12-08  225  	}
6a099c63 Dongjin Kim 2012-12-08  226  
6a099c63 Dongjin Kim 2012-12-08  227  	if (gpio_is_valid(hub->gpio_reset)) {
6a099c63 Dongjin Kim 2012-12-08  228  		err = gpio_request_one(hub->gpio_reset,
6a099c63 Dongjin Kim 2012-12-08  229  				GPIOF_OUT_INIT_LOW, "usb3503 reset");
6a099c63 Dongjin Kim 2012-12-08  230  		if (err) {
6a099c63 Dongjin Kim 2012-12-08  231  			dev_err(&i2c->dev,
6a099c63 Dongjin Kim 2012-12-08  232  					"unable to request GPIO %d as reset pin (%d)\n",
6a099c63 Dongjin Kim 2012-12-08  233  					hub->gpio_reset, err);
6a099c63 Dongjin Kim 2012-12-08  234  			goto err_gpio_reset;
6a099c63 Dongjin Kim 2012-12-08  235  		}
6a099c63 Dongjin Kim 2012-12-08  236  	}
6a099c63 Dongjin Kim 2012-12-08  237  
6a099c63 Dongjin Kim 2012-12-08 @238  	usb3503_switch_mode(hub, pdata->initial_mode);
6a099c63 Dongjin Kim 2012-12-08  239  
6a099c63 Dongjin Kim 2012-12-08  240  	dev_info(&i2c->dev, "%s: probed on  %s mode\n", __func__,
6a099c63 Dongjin Kim 2012-12-08  241  			(hub->mode == USB3503_MODE_HUB) ? "hub" : "standby");

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux