Commit b84c5199 authored by Aditya Pakki's avatar Aditya Pakki Committed by Kelsey Skunberg

orinoco: avoid assertion in case of NULL pointer

BugLink: https://bugs.launchpad.net/bugs/1868627

[ Upstream commit c705f9fc ]

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: default avatarAditya Pakki <pakki001@umn.edu>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent fe60747b
......@@ -1351,7 +1351,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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment