Skip to content

Commit

Permalink
Bluetooth: hci_intel: Add check for platform_driver_register
Browse files Browse the repository at this point in the history
[ Upstream commit ab2d2a9 ]

As platform_driver_register() could fail, it should be better
to deal with the return value in order to maintain the code
consisitency.

Fixes: 1ab1f23 ("Bluetooth: hci_intel: Add support for platform driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JiangJias authored and gregkh committed Aug 17, 2022
1 parent d1bedcd commit aa6da8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/bluetooth/hci_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,11 @@ static struct platform_driver intel_driver = {

int __init intel_init(void)
{
platform_driver_register(&intel_driver);
int err;

err = platform_driver_register(&intel_driver);
if (err)
return err;

return hci_uart_register_proto(&intel_proto);
}
Expand Down

0 comments on commit aa6da8c

Please sign in to comment.