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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Apr 2017 14:48:26 +0000 (16:48 +0200)
commitec1dafe8ec5f846d6b1b280309d8b03d25b096fd
tree97db37e7086b663b6164071136e21dfa7efecff4
parentba7756d08212f71a009a4ac7439b8e661e469f7d
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