Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e471d9ca authored by Manohar Vavilapalli's avatar Manohar Vavilapalli Committed by Gerrit - the friendly Code Review server
Browse files

drivers: iio: imu: Add NULL check before using 'irq_get_irq_data'



Add NULL check to avoid potential NULL pointer dereference.

Change-Id: Id383ce6deb7139a32e77567afedbe854c2b5654f
Signed-off-by: default avatarManohar Vavilapalli <mvavilap@codeaurora.org>
parent a4dc5255
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -538,6 +538,8 @@ int st_asm330lhh_fifo_setup(struct st_asm330lhh_hw *hw)
	bool irq_active_low;
	bool irq_active_low;
	int i, err;
	int i, err;


	if (!irq_get_irq_data(hw->irq))
		return -EINVAL;
	irq_type = irqd_get_trigger_type(irq_get_irq_data(hw->irq));
	irq_type = irqd_get_trigger_type(irq_get_irq_data(hw->irq));
	if (irq_type == IRQF_TRIGGER_NONE)
	if (irq_type == IRQF_TRIGGER_NONE)
		irq_type = IRQF_TRIGGER_HIGH;
		irq_type = IRQF_TRIGGER_HIGH;