projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc36ef8
)
ALSA: seq: oss: Fix error check at system port creation
author
Takashi Iwai
<tiwai@suse.de>
Thu, 17 Jun 2021 13:47:42 +0000
(15:47 +0200)
committer
Takashi Iwai
<tiwai@suse.de>
Thu, 17 Jun 2021 14:02:26 +0000
(16:02 +0200)
The system port creation in ALSA OSS sequencer was wrongly checked
against to the port number that can be never negative. The error code
should be checked rather against the ioctl call.
This patch corrects the error check.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link:
https://lore.kernel.org/r/20210617134742.6321-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/oss/seq_oss_init.c
patch
|
blob
|
history
diff --git
a/sound/core/seq/oss/seq_oss_init.c
b/sound/core/seq/oss/seq_oss_init.c
index a53d81a86af2d6e0e8393a3719d8431b468611d1..0ee4a5081fd6a0a19a24018e8af71088ae25a934 100644
(file)
--- a/
sound/core/seq/oss/seq_oss_init.c
+++ b/
sound/core/seq/oss/seq_oss_init.c
@@
-94,11
+94,10
@@
snd_seq_oss_create_client(void)
port_callback.event_input = receive_announce;
port->kernel = &port_callback;
- call_ctl(SNDRV_SEQ_IOCTL_CREATE_PORT, port);
- system_port = port->addr.port;
- if (system_port >= 0) {
+ if (call_ctl(SNDRV_SEQ_IOCTL_CREATE_PORT, port) >= 0) {
struct snd_seq_port_subscribe subs;
+ system_port = port->addr.port;
memset(&subs, 0, sizeof(subs));
subs.sender.client = SNDRV_SEQ_CLIENT_SYSTEM;
subs.sender.port = SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE;