Re: usbip: vudc: Add SysFS infrastructure for VUDC

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

 




On 04/29/2016 11:02 AM, Dan Carpenter wrote:
> Hello Igor Kotrasinski,
> 
> The patch ea6873a45a22: "usbip: vudc: Add SysFS infrastructure for
> VUDC" from Mar 8, 2016, leads to the following static checker warning:
> 
> 	drivers/usb/usbip/vudc_sysfs.c:201 usbip_status_show()
> 	error: we previously assumed 'udc' could be null (see line 200)
> 
> drivers/usb/usbip/vudc_sysfs.c
>    194  static ssize_t usbip_status_show(struct device *dev,
>    195                                 struct device_attribute *attr, char *out)
>    196  {
>    197          struct vudc *udc = (struct vudc *) dev_get_drvdata(dev);
>    198          int status;
>    199  
>    200          if (!udc) {
>                     ^^^^
> Check.
> 
>    201                  dev_err(&udc->pdev->dev, "no device");
>                                  ^^^^^^^^^^^^^^
> Dereference.
> 
>    202                  return -ENODEV;
>    203          }
>    204          spin_lock_irq(&udc->ud.lock);
>    205          status = udc->ud.status;
>    206          spin_unlock_irq(&udc->ud.lock);
>    207  
>    208          return snprintf(out, PAGE_SIZE, "%d\n", status);
>    209  }
> 

This one is a real mistake. I will fix it in a minute.

Thanks,
-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
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