projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4997bf
)
ALSA: usx2y: Don't call free_pages_exact() with NULL address
author
Takashi Iwai
<tiwai@suse.de>
Mon, 17 May 2021 13:15:43 +0000
(15:15 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:39 +0000
(16:05 +0200)
[ Upstream commit
cae0cf651adccee2c3f376e78f30fbd788d0829f
]
Unlike some other functions, we can't pass NULL pointer to
free_pages_exact(). Add a proper NULL check for avoiding possible
Oops.
Link:
https://lore.kernel.org/r/20210517131545.27252-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/usx2y/usb_stream.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/usb/usx2y/usb_stream.c
b/sound/usb/usx2y/usb_stream.c
index 091c071b270af30925223b9ede5813e23fc82099..cff684942c4f0ff22c43cff9cc7b7d346e5c7bc2 100644
(file)
--- a/
sound/usb/usx2y/usb_stream.c
+++ b/
sound/usb/usx2y/usb_stream.c
@@
-142,8
+142,11
@@
void usb_stream_free(struct usb_stream_kernel *sk)
if (!s)
return;
- free_pages_exact(sk->write_page, s->write_size);
- sk->write_page = NULL;
+ if (sk->write_page) {
+ free_pages_exact(sk->write_page, s->write_size);
+ sk->write_page = NULL;
+ }
+
free_pages_exact(s, s->read_size);
sk->s = NULL;
}