Hello Li Yang,
The patch b504882da539: "USB: add Freescale high-speed USB SOC device
controller driver" from Apr 23, 2007, leads to the following Smatch
warning:
drivers/usb/gadget/udc/fsl_udc_core.c:917 fsl_ep_queue()
warn: variable dereferenced before check 'req' (see line 880)
drivers/usb/gadget/udc/fsl_udc_core.c
899
900 ret = usb_gadget_map_request(&ep->udc->gadget, &req->req,
ep_is_in(ep));
901 if (ret)
902 return ret;
903
904 req->req.status = -EINPROGRESS;
905 req->req.actual = 0;
906 req->dtd_count = 0;
^^^^^^^^^^^^^
907
908 /* build dtds and push them to device queue */
909 if (!fsl_req_to_dtd(req, gfp_flags)) {
910 spin_lock_irqsave(&udc->lock, flags);
911 fsl_queue_td(ep, req);
912 } else {
913 return -ENOMEM;
914 }
915
916 /* irq handler advances the queue */
917 if (req != NULL)
^^^^^^^^^^^
"req" can't be NULL here, but I'm not sure if something else was
intended?
918 list_add_tail(&req->queue, &ep->queue);
919 spin_unlock_irqrestore(&udc->lock, flags);
920
921 return 0;
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html