提交 90e41f9d 编写于 作者: C Carlos Chinea

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: NCarlos Chinea <carlos.chinea@nokia.com>
Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: NLinus Walleij <linus.walleij@linaro.org>
上级 5a218ceb
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册