> vdev_to_vhci() derefernces "vdev" to get vdev->rhport
Yes, you are right.
Sorry about my misreading.
I'm creating the patch and will send later.
Thank you for your help,
> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
> Sent: Wednesday, October 12, 2016 5:57 PM
> To: fx IWATA NOBUO
> Cc: email@example.com
> Subject: Re: usbip: vhci extension: modifications to vhci driver
> On Wed, Oct 12, 2016 at 05:24:31AM +0000, fx IWATA NOBUO wrote:
> > Hello,
> > I will send a patch to clear this warning.
> > The current behavior is as following:
> > vdev_to_vhci() is inline of container_of().
> > A pointer (struct vhci_hcd *vhci) may be container_of() from NULL for
> > a while.
> > If it is container_of() from NULL, it will not be referenced because
> > of NULL check of source pointer of the container_of().
> Are you looking at linux-next? vdev_to_vhci() derefernces "vdev" to get
> vdev->rhport so this is a bug and not a false positive.
> Smatch sometimes does have false positives because it thinks foo->array
> is a dereference when really we're taking the address of the array. I should
> fix that... But it understands that container_of(NULL) is ok.
> dan carpenter
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html