All of lore.kernel.org
 help / color / mirror / Atom feed
* [xhci:rewrite_invalid_context_at_stop_endpoint 6/7] drivers/usb/host/xhci-ring.c:2129:6: warning: Either the condition 'td' is redundant or there is possible null pointer dereference: td.
@ 2020-10-21 23:43 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-10-21 23:43 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3924 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Mathias Nyman <mathias.nyman@linux.intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git rewrite_invalid_context_at_stop_endpoint
head:   713ccf6a9e51951510781a31ab8d81a255da79d0
commit: 6cbbe8dd90029b28a579b2871b383b1e10230c4e [6/7] xhci: introduce a new move_dequeue_past_td() function to replace old code.
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
compiler: alpha-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

   In file included from drivers/usb/host/xhci-ring.c:
   drivers/usb/host/xhci.h:2454:11: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      ret += sprintf(str + ret, " %d%s",
             ^
   drivers/usb/host/xhci.h:2466:11: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      ret += sprintf(str + ret, " %d%s",
             ^
>> drivers/usb/host/xhci-ring.c:2129:6: warning: Either the condition 'td' is redundant or there is possible null pointer dereference: td. [nullPointerRedundantCheck]
    if (td->urb->dev->tt && !usb_pipeint(td->urb->pipe) &&
        ^
   drivers/usb/host/xhci-ring.c:2158:7: note: Assuming that condition 'td' is not redundant
     if (td && list_empty(&td->cancelled_td_list)) {
         ^
   drivers/usb/host/xhci-ring.c:2163:34: note: Calling function 'xhci_clear_hub_tt_buffer', 2nd argument 'td' value is 0
     xhci_clear_hub_tt_buffer(xhci, td, ep);
                                    ^
   drivers/usb/host/xhci-ring.c:2129:6: note: Null pointer dereference
    if (td->urb->dev->tt && !usb_pipeint(td->urb->pipe) &&
        ^
   drivers/usb/host/xhci-ring.c:4052:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
     sia_frame_id = TRB_SIA;
                    ^

vim +/td +2129 drivers/usb/host/xhci-ring.c

d0e96f5a71a032c Sarah Sharp 2009-04-27  2121  
ef513be0a9057cc Jim Lin     2019-06-03  2122  static void xhci_clear_hub_tt_buffer(struct xhci_hcd *xhci, struct xhci_td *td,
ef513be0a9057cc Jim Lin     2019-06-03  2123  		struct xhci_virt_ep *ep)
ef513be0a9057cc Jim Lin     2019-06-03  2124  {
ef513be0a9057cc Jim Lin     2019-06-03  2125  	/*
ef513be0a9057cc Jim Lin     2019-06-03  2126  	 * As part of low/full-speed endpoint-halt processing
ef513be0a9057cc Jim Lin     2019-06-03  2127  	 * we must clear the TT buffer (USB 2.0 specification 11.17.5).
ef513be0a9057cc Jim Lin     2019-06-03  2128  	 */
ef513be0a9057cc Jim Lin     2019-06-03 @2129  	if (td->urb->dev->tt && !usb_pipeint(td->urb->pipe) &&
ef513be0a9057cc Jim Lin     2019-06-03  2130  	    (td->urb->dev->tt->hub != xhci_to_hcd(xhci)->self.root_hub) &&
ef513be0a9057cc Jim Lin     2019-06-03  2131  	    !(ep->ep_state & EP_CLEARING_TT)) {
ef513be0a9057cc Jim Lin     2019-06-03  2132  		ep->ep_state |= EP_CLEARING_TT;
ef513be0a9057cc Jim Lin     2019-06-03  2133  		td->urb->ep->hcpriv = td->urb->dev;
ef513be0a9057cc Jim Lin     2019-06-03  2134  		if (usb_hub_clear_tt_buffer(td->urb))
ef513be0a9057cc Jim Lin     2019-06-03  2135  			ep->ep_state &= ~EP_CLEARING_TT;
ef513be0a9057cc Jim Lin     2019-06-03  2136  	}
ef513be0a9057cc Jim Lin     2019-06-03  2137  }
ef513be0a9057cc Jim Lin     2019-06-03  2138  

:::::: The code at line 2129 was first introduced by commit
:::::: ef513be0a9057cc6baf5d29566aaaefa214ba344 usb: xhci: Add Clear_TT_Buffer

:::::: TO: Jim Lin <jilin@nvidia.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-21 23:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 23:43 [xhci:rewrite_invalid_context_at_stop_endpoint 6/7] drivers/usb/host/xhci-ring.c:2129:6: warning: Either the condition 'td' is redundant or there is possible null pointer dereference: td kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.