[PATCH v2] hsi: fix double kfree

From: Geliang Tang
Date: Thu Oct 01 2015 - 10:37:13 EST


When device_register() fails, kfree() is called in hsi_client_release(),
hence there is no need to call kfree in err3 again.

Signed-off-by: Geliang Tang <geliangtang@xxxxxxx>

---
Changes in v2:
- Just to make myself clearer that what I did in this patch.
---
drivers/hsi/hsi.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/hsi/hsi.c b/drivers/hsi/hsi.c
index fe93712..35d631e 100644
--- a/drivers/hsi/hsi.c
+++ b/drivers/hsi/hsi.c
@@ -300,7 +300,6 @@ static void hsi_add_client_from_dt(struct hsi_port *port,
if (device_register(&cl->device) < 0) {
pr_err("hsi: failed to register client: %s\n", name);
put_device(&cl->device);
- goto err3;
}

return;
--
2.5.0


--
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/