xhci: use correct flags for spin_lock_irqrestore() when setting port power
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 13 Apr 2017 11:01:04 +0000 (14:01 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:33:45 +0000 (15:33 -0500)
commit6aa7752b9e24162834536b4a49802879d353681e
tree3425c04a846162164f985661d47e5d4247be4a93
parentaa48abc1e5a083e14c1b78e0d3cf31180d1a7fa7
xhci: use correct flags for spin_lock_irqrestore() when setting port power

commit a6ff6cbf1fab ("usb: xhci: Add helper function xhci_set_power_on().")
created a helper to control port power that needs to be called with
xhci->lock held and interrupts disabled.
It released the lock with spin_unlock_irqrestore using a new zero flag
variable instead of the original flag from spin_lock_irqsave.
This regression triggered a static checker warning about bogus flags, and
a null pointer dereference on armada-385.

Fix it by passing a pointer to the correct flags and using it instead

Fixes: a6ff6cbf1fab ("usb: xhci: Add helper function xhci_set_power_on().")
Cc: Guoqing Zhang <guoqing.zhang@intel.com>
Reported-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Tested-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-hub.c