Skip to contentSkip to conversation

Input: fix missing unlock on error in rmi_f54_request_report()

PATCH In review Wei Yongjun 2 participants 2 messages Sep 13, 2016 – Sep 15, 2016

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

PATCH 1/1 Input: fix missing unlock on error in rmi_f54_request_report()

From: Wei Yongjun <[email protected]>

Add the missing unlock before return from function rmi_f54_request_report() in the error handling case.

---
 drivers/input/rmi4/rmi_f54.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/rmi4/rmi_f54.c +3 -1
index bd86d3d..99a8836 100644
@@ -198,8 +198,10 @@ static int rmi_f54_request_report(struct rmi_function *fn, u8 report_type)
 	mutex_lock(&f54->data_mutex);
 
 	error = rmi_write(rmi_dev, fn->fd.command_base_addr, F54_GET_REPORT);
-	if (error < 0)
+	if (error < 0) {
+		mutex_unlock(&f54->data_mutex);
 		return error;
+	}
 
 	init_completion(&f54->cmd_done);
 
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Wei Yongjun

Add the missing unlock before return from function rmi_f54_request_report() in the error handling case.

Quoted 20 lines
---
 drivers/input/rmi4/rmi_f54.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/rmi4/rmi_f54.c +3 -1
index bd86d3d..99a8836 100644
@@ -198,8 +198,10 @@ static int rmi_f54_request_report(struct rmi_function *fn, u8 report_type)
 	mutex_lock(&f54->data_mutex);
 
 	error = rmi_write(rmi_dev, fn->fd.command_base_addr, F54_GET_REPORT);
-	if (error < 0)
+	if (error < 0) {
+		mutex_unlock(&f54->data_mutex);
 		return error;
+	}
 
 	init_completion(&f54->cmd_done);