Skip to contentSkip to conversation

Input: synaptics-rmi4 - fix error return code in rmi_probe_interrupts()

PATCH Applied Wei Yongjun 3 participants 3 messages Feb 7, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: synaptics-rmi4 - fix error return code in rmi_probe_interrupts()

From: Wei Yongjun <[email protected]>

Fix to return error code -ENOMEM from the devm_kzalloc() error handling case instead of 0, as done elsewhere in this function.

Fixes 6bd0dcfacf28 ("Input: synaptics-rmi4 - factor out functions

from probe")

---
 drivers/input/rmi4/rmi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +1 -1
index bf5c36e..0c54446 100644
@@ -1049,7 +1049,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
 	data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL);
 	if (!data->irq_memory) {
 		dev_err(dev, "Failed to allocate memory for irq masks.\n");
-		return retval;
+		return -ENOMEM;
 	}
 
 	data->irq_status	= data->irq_memory + size * 0;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fix to return error code -ENOMEM from the devm_kzalloc() error handling case instead of 0, as done elsewhere in this function.

Fixes 6bd0dcfacf28 ("Input: synaptics-rmi4 - factor out functions

from probe")

---

Good catch.

Quoted 17 lines
 drivers/input/rmi4/rmi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +1 -1
index bf5c36e..0c54446 100644
@@ -1049,7 +1049,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
 	data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL);
 	if (!data->irq_memory) {
 		dev_err(dev, "Failed to allocate memory for irq masks.\n");
-		return retval;
+		return -ENOMEM;
 	}
 
 	data->irq_status	= data->irq_memory + size * 0;
maintainer Applied
#2 lore raw
Quoted 6 lines · Benjamin Tissoires
Quoted 5 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fix to return error code -ENOMEM from the devm_kzalloc() error handling case instead of 0, as done elsewhere in this function.

Quoted 8 lines
Quoted 4 lines
Fixes 6bd0dcfacf28 ("Input: synaptics-rmi4 - factor out functions

from probe")

---

Good catch.

Applied, thank you.

Quoted 18 lines
Quoted 18 lines
 drivers/input/rmi4/rmi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +1 -1
index bf5c36e..0c54446 100644
@@ -1049,7 +1049,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
 	data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL);
 	if (!data->irq_memory) {
 		dev_err(dev, "Failed to allocate memory for irq masks.\n");
-		return retval;
+		return -ENOMEM;
 	}
 
 	data->irq_status	= data->irq_memory + size * 0;
Signature · 1 line
Dmitry