[bug report] xhci: add support to allocate several interrupters

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

 



Hello Mathias Nyman,

The patch c99b38c41234: "xhci: add support to allocate several
interrupters" from Jan 2, 2024 (linux-next), leads to the following
Smatch static checker warning:

	drivers/usb/host/xhci-mem.c:1873 xhci_remove_secondary_interrupter()
	error: we previously assumed 'ir' could be null (see line 1865)

drivers/usb/host/xhci-mem.c
    1863 
    1864         /* interrupter 0 is primary interrupter, don't touch it */
    1865         if (!ir || !ir->intr_num || ir->intr_num >= xhci->max_interrupters)
    1866                 xhci_dbg(xhci, "Invalid secondary interrupter, can't remove\n");

This debug message is kind of pointless...  The Oops will have the stack
trace already.

    1867 
    1868         /* fixme, should we check xhci->interrupter[intr_num] == ir */
    1869         /* fixme locking */
    1870 
    1871         spin_lock_irq(&xhci->lock);
    1872 
--> 1873         intr_num = ir->intr_num;
                            ^^^^^^^^^^^^
Unchecked dereference

    1874 
    1875         xhci_remove_interrupter(xhci, ir);
    1876         xhci->interrupters[intr_num] = NULL;
    1877 
    1878         spin_unlock_irq(&xhci->lock);
    1879 
    1880         xhci_free_interrupter(xhci, ir);
    1881 }

regards,
dan carpenter




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux