diff options
author | Aditya Pakki <pakki001@umn.edu> | 2019-12-15 13:58:58 -0600 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-12-18 21:09:33 +0200 |
commit | c705f9fc6a1736dcf6ec01f8206707c108dca824 (patch) | |
tree | cb1c544a2cd41396486b97510a0aa1de007349d3 | |
parent | a32de68edab7b73ded850bcf76cdf6858e92a7e5 (diff) |
orinoco: avoid assertion in case of NULL pointer
In ezusb_init, if upriv is NULL, the code crashes. However, the caller
in ezusb_probe can handle the error and print the failure message.
The patch replaces the BUG_ON call to error return.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c index 8c79b963bcff..e753f43e0162 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c @@ -1361,7 +1361,8 @@ static int ezusb_init(struct hermes *hw) int retval; BUG_ON(in_interrupt()); - BUG_ON(!upriv); + if (!upriv) + return -EINVAL; upriv->reply_count = 0; /* Write the MAGIC number on the simulated registers to keep |