projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0005151
)
ALSA: usx2y: Fix potential NULL dereference
author
Takashi Iwai
<tiwai@suse.de>
Mon, 20 Apr 2020 07:55:29 +0000
(09:55 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 29 Apr 2020 14:33:15 +0000
(16:33 +0200)
commit
7686e3485253635c529cdd5f416fc640abaf076f
upstream.
The error handling code in usX2Y_rate_set() may hit a potential NULL
dereference when an error occurs before allocating all us->urb[].
Add a proper NULL check for fixing the corner case.
Reported-by: Lin Yi <teroincn@gmail.com>
Cc: <stable@vger.kernel.org>
Link:
https://lore.kernel.org/r/20200420075529.27203-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/usx2y/usbusx2yaudio.c
patch
|
blob
|
history
diff --git
a/sound/usb/usx2y/usbusx2yaudio.c
b/sound/usb/usx2y/usbusx2yaudio.c
index
89fa287
..
e0bace4
100644
(file)
--- a/
sound/usb/usx2y/usbusx2yaudio.c
+++ b/
sound/usb/usx2y/usbusx2yaudio.c
@@
-681,6
+681,8
@@
static int usX2Y_rate_set(struct usX2Ydev *usX2Y, int rate)
us->submitted = 2*NOOF_SETRATE_URBS;
for (i = 0; i < NOOF_SETRATE_URBS; ++i) {
struct urb *urb = us->urb[i];
us->submitted = 2*NOOF_SETRATE_URBS;
for (i = 0; i < NOOF_SETRATE_URBS; ++i) {
struct urb *urb = us->urb[i];
+ if (!urb)
+ continue;
if (urb->status) {
if (!err)
err = -ENODEV;
if (urb->status) {
if (!err)
err = -ENODEV;