Skip to content

Commit

Permalink
HSI: hsi: Fix error path cleanup on client registration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Carlos Chinea committed Apr 23, 2012
1 parent 5a218ce commit 90e41f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hsi/hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 90e41f9

Please sign in to comment.