Commit 8685c46d authored by Peter Chen's avatar Peter Chen Committed by Greg Kroah-Hartman

usb: cdns3: gadget: unsigned int is dereferenced as a wider unsigned long

It is reported by Coverity scan, and fixed it by declare the reg as
unsigned long.
Reviewed-by: default avatarJun Li <jun.li@nxp.com>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
Acked-by: default avatarRoger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20200623031001.8469-3-peter.chen@nxp.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a582641
...@@ -1810,7 +1810,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data) ...@@ -1810,7 +1810,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
irqreturn_t ret = IRQ_NONE; irqreturn_t ret = IRQ_NONE;
unsigned long flags; unsigned long flags;
int bit; int bit;
u32 reg; unsigned long reg;
spin_lock_irqsave(&priv_dev->lock, flags); spin_lock_irqsave(&priv_dev->lock, flags);
...@@ -1841,7 +1841,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data) ...@@ -1841,7 +1841,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
if (!reg) if (!reg)
goto irqend; goto irqend;
for_each_set_bit(bit, (unsigned long *)&reg, for_each_set_bit(bit, &reg,
sizeof(u32) * BITS_PER_BYTE) { sizeof(u32) * BITS_PER_BYTE) {
cdns3_check_ep_interrupt_proceed(priv_dev->eps[bit]); cdns3_check_ep_interrupt_proceed(priv_dev->eps[bit]);
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment