summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2019-12-15 22:58:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-28 18:36:01 +0300
commit4a30decabbb4a4d15dd5da43f9e1780062bdc487 (patch)
tree80be225104e38183077e620d5e970af046d74bee /drivers/net/wireless
parentf5fb8b53423e989da9df0e87981faf90f373ebcc (diff)
downloadlinux-4a30decabbb4a4d15dd5da43f9e1780062bdc487.tar.xz
orinoco: avoid assertion in case of NULL pointer
[ Upstream commit c705f9fc6a1736dcf6ec01f8206707c108dca824 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/intersil/orinoco/orinoco_usb.c3
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 95015d74b1c0..5a64674a5c8d 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
@@ -1364,7 +1364,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