Skip to content

Commit

Permalink
ath6kl: check usb_register() return value
Browse files Browse the repository at this point in the history
ath6kl_usb_init() does not check usb_register() return value.
As a result it may incorrectly report success of driver initialization.

Found by Linux Driver Verification project (linuxtesting.org).

kvalo: fix commit title and make cosmetic changes to the code to follow
more the style used in the driver

Signed-off-by: Marina Makienko <makienko@ispras.ru>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Marina Makienko authored and Kalle Valo committed Oct 24, 2012
1 parent 8114f9b commit a3b3842
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/net/wireless/ath/ath6kl/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,14 @@ static struct usb_driver ath6kl_usb_driver = {

static int ath6kl_usb_init(void)
{
usb_register(&ath6kl_usb_driver);
int ret;

ret = usb_register(&ath6kl_usb_driver);
if (ret) {
ath6kl_err("usb registration failed: %d\n", ret);
return ret;
}

return 0;
}

Expand Down

0 comments on commit a3b3842

Please sign in to comment.