[PATCH next 6/6] staging: ste_rmi4: fix memory leaks

From: Alexander Beregalov
Date: Wed Mar 09 2011 - 21:44:18 EST


Free resources before exit.

Signed-off-by: Alexander Beregalov <a.beregalov@xxxxxxxxx>
---
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 51b4a79..d55a8e4 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;
}
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/