* [PATCH] net: Checking usb_register() return value
@ 2012-08-14 8:11 Marina Makienko
2012-08-14 14:34 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Marina Makienko @ 2012-08-14 8:11 UTC (permalink / raw)
To: Kalle Valo
Cc: Marina Makienko, John W. Linville, linux-wireless, netdev,
linux-kernel, ldv-project
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).
Signed-off-by: Marina Makienko <makienko@ispras.ru>
---
drivers/net/wireless/ath/ath6kl/usb.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index 3740c3d..39f05da 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -1196,7 +1196,11 @@ static struct usb_driver ath6kl_usb_driver = {
static int ath6kl_usb_init(void)
{
- usb_register(&ath6kl_usb_driver);
+ int ret = usb_register(&ath6kl_usb_driver);
+ if (ret) {
+ ath6kl_err("usb_register() failed: %d\n", ret);
+ return ret;
+ }
return 0;
}
--
1.7.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: Checking usb_register() return value
2012-08-14 8:11 [PATCH] net: Checking usb_register() return value Marina Makienko
@ 2012-08-14 14:34 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2012-08-14 14:34 UTC (permalink / raw)
To: Marina Makienko
Cc: John W. Linville, linux-wireless, netdev, linux-kernel,
ldv-project, ath6kl-devel
On 08/14/2012 11:11 AM, Marina Makienko wrote:
> 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).
>
> Signed-off-by: Marina Makienko <makienko@ispras.ru>
Thanks, applied to ath6kl.git. But I changed the title to use "ath6kl:"
and made some cosmetic changes to the code.
Kalle
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-14 14:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-14 8:11 [PATCH] net: Checking usb_register() return value Marina Makienko
2012-08-14 14:34 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).