re: usb: gadget: Update fsl_udc_core to use usb_endpoint_descriptor inside the struct usb_ep

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

 



Hello Ido Shayevitz,

The patch 79149b8bd027: "usb: gadget: Update fsl_udc_core to use
usb_endpoint_descriptor inside the struct usb_ep" from Mar 12, 2012,
leads to the following static checker warning:

	drivers/usb/gadget/udc/fsl_udc_core.c:1060 fsl_ep_fifo_status()
	error: we previously assumed 'ep->ep.desc' could be null (see line 1060)

drivers/usb/gadget/udc/fsl_udc_core.c
  1051  static int fsl_ep_fifo_status(struct usb_ep *_ep)
  1052  {
  1053          struct fsl_ep *ep;
  1054          struct fsl_udc *udc;
  1055          int size = 0;
  1056          u32 bitmask;
  1057          struct ep_queue_head *qh;
  1058  
  1059          ep = container_of(_ep, struct fsl_ep, ep);
  1060          if (!_ep || (!ep->ep.desc && ep_index(ep) != 0))
                              ^^^^^^^^^^^    ^^^^^^^^^^^^
Was || intended insteadof &&?  If "ep->ep.desc" is NULL then the current
code will Oops inside the ep_index() macro.

  1061                  return -ENODEV;
  1062  
  1063          udc = (struct fsl_udc *)ep->udc;
  1064  

regards,
dan carpenter
--
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