From 819d4eb11605408e0267301d8853367ff82286a5 Mon Sep 17 00:00:00 2001 From: Alexander Beregalov Date: Sun, 13 Mar 2011 21:58:50 +0300 Subject: [PATCH] staging: ste_rmi4: fix memory leaks Free resources before exit. Signed-off-by: Alexander Beregalov Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c index 51b4a79e4b8..d55a8e40318 100644 --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c @@ -764,8 +764,10 @@ static int synaptics_rmi4_i2c_query_device(struct synaptics_rmi4_data *pdata) (pdata, rfi, &rmi_fd, intr_count); - if (retval < 0) + if (retval < 0) { + kfree(rfi); return retval; + } } break; } -- 2.39.5