From: Carlos Chinea Date: Wed, 11 Apr 2012 08:01:11 +0000 (+0300) Subject: HSI: hsi: Fix error path cleanup on client registration X-Git-Tag: v3.4-rc5~35^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90e41f9dc75b47ab94e2191e4c86aa8259699a33;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Acked-by: Greg Kroah-Hartman Acked-by: Linus Walleij --- diff --git a/drivers/hsi/hsi.c b/drivers/hsi/hsi.c index c17d12c..5c76a36 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) 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); } }