[PATCH 4/5] input/rmi4/rmi_driver: check if irq_find_mapping returns 0

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

 



The irq_find_mapping() function can return 0 when called in the
rmi_process_interrupt_requests() function.

This causes a kernel crash. Check for a 0 value and skip calling
handle_nested_irq() in that case.

This was tested with the F54 function enabled on a Lenovo X1 Carbon.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
Fixes: 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to irq_domain")
---
 drivers/input/rmi4/rmi_driver.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 772493b1f665..6085ec424a84 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -154,8 +154,12 @@ static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev)
 	 */
 	mutex_unlock(&data->irq_mutex);
 
-	for_each_set_bit(i, data->irq_status, data->irq_count)
-		handle_nested_irq(irq_find_mapping(data->irqdomain, i));
+	for_each_set_bit(i, data->irq_status, data->irq_count) {
+		unsigned int irq = irq_find_mapping(data->irqdomain, i);
+
+		if (irq)
+			handle_nested_irq(irq);
+	}
 
 	if (data->input)
 		input_sync(data->input);
-- 
2.23.0




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux