lkml.org 
[lkml]   [2012]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] net: Checking usb_register() return value
Date
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


\
 
 \ /
  Last update: 2012-08-14 10:42    [W:0.205 / U:2.868 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site