diff options
author | Carlos Chinea <carlos.chinea@nokia.com> | 2012-04-11 04:01:11 -0400 |
---|---|---|
committer | Carlos Chinea <carlos.chinea@nokia.com> | 2012-04-23 07:23:31 -0400 |
commit | 90e41f9dc75b47ab94e2191e4c86aa8259699a33 (patch) | |
tree | fa163ec22d60c9c8f270fca4f31c2bf39aae4acd /drivers/hsi/hsi.c | |
parent | 5a218ceba7b64f506bf4f004b04bb457c1805a62 (diff) |
HSI: hsi: Fix error path cleanup on client registration
HSI client structure should be freed on error path after
calling device_registration by dropping a reference to it.
Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/hsi/hsi.c')
-rw-r--r-- | drivers/hsi/hsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hsi/hsi.c b/drivers/hsi/hsi.c index c17d12ca8e7f..5c76a36419d4 100644 --- a/drivers/hsi/hsi.c +++ b/drivers/hsi/hsi.c | |||
@@ -100,7 +100,7 @@ static void hsi_new_client(struct hsi_port *port, struct hsi_board_info *info) | |||
100 | cl->device.archdata = *info->archdata; | 100 | cl->device.archdata = *info->archdata; |
101 | if (device_register(&cl->device) < 0) { | 101 | if (device_register(&cl->device) < 0) { |
102 | pr_err("hsi: failed to register client: %s\n", info->name); | 102 | pr_err("hsi: failed to register client: %s\n", info->name); |
103 | kfree(cl); | 103 | put_device(&cl->device); |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||