1
0
Fork 0

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>
hifive-unleashed-5.1
Carlos Chinea 2012-04-11 11:01:11 +03:00
parent 5a218ceba7
commit 90e41f9dc7
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ static void hsi_new_client(struct hsi_port *port, struct hsi_board_info *info)
cl->device.archdata = *info->archdata;
if (device_register(&cl->device) < 0) {
pr_err("hsi: failed to register client: %s\n", info->name);
kfree(cl);
put_device(&cl->device);
}
}