[PATCH 2/3] usb: cdns3: gadget: unsigned int is dereferenced as a wider unsigned long

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

 



It is reported by Coverity scan, and fixed it by declare the reg as
unsigned long.

Reviewed-by: Jun Li <jun.li@xxxxxxx>
Signed-off-by: Peter Chen <peter.chen@xxxxxxx>
---
 drivers/usb/cdns3/gadget.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index eac01b1a4958..2362faf7efeb 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -1813,7 +1813,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
 	irqreturn_t ret = IRQ_NONE;
 	unsigned long flags;
 	int bit;
-	u32 reg;
+	unsigned long reg;
 
 	spin_lock_irqsave(&priv_dev->lock, flags);
 
@@ -1844,7 +1844,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
 	if (!reg)
 		goto irqend;
 
-	for_each_set_bit(bit, (unsigned long *)&reg,
+	for_each_set_bit(bit, &reg,
 			 sizeof(u32) * BITS_PER_BYTE) {
 		cdns3_check_ep_interrupt_proceed(priv_dev->eps[bit]);
 		ret = IRQ_HANDLED;
-- 
2.17.1




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

  Powered by Linux