diff options
author | Marina Makienko <makienko@ispras.ru> | 2012-08-14 04:11:30 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-10-24 04:49:46 -0400 |
commit | a3b3842c2e27ba07f8f7944a76013425d182c47b (patch) | |
tree | 20adb50181999a04ced529c6a1e751d30c53cd3f | |
parent | 8114f9b6d28686de02c3f83f0543665728b1a15b (diff) |
ath6kl: check usb_register() return value
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>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/usb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c index 4aa97aa6611..a6d13775467 100644 --- a/drivers/net/wireless/ath/ath6kl/usb.c +++ b/drivers/net/wireless/ath/ath6kl/usb.c | |||
@@ -1196,7 +1196,14 @@ static struct usb_driver ath6kl_usb_driver = { | |||
1196 | 1196 | ||
1197 | static int ath6kl_usb_init(void) | 1197 | static int ath6kl_usb_init(void) |
1198 | { | 1198 | { |
1199 | usb_register(&ath6kl_usb_driver); | 1199 | int ret; |
1200 | |||
1201 | ret = usb_register(&ath6kl_usb_driver); | ||
1202 | if (ret) { | ||
1203 | ath6kl_err("usb registration failed: %d\n", ret); | ||
1204 | return ret; | ||
1205 | } | ||
1206 | |||
1200 | return 0; | 1207 | return 0; |
1201 | } | 1208 | } |
1202 | 1209 | ||