Unverified Commit 565cf970 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15128 ALSA: seq: oss: Fix races at processing SysEx messages

parents 4c02bc5f 07460bed
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ static struct seq_oss_synth midi_synth_dev = {
};

static DEFINE_SPINLOCK(register_lock);
static DEFINE_MUTEX(sysex_mutex);

/*
 * prototypes
@@ -497,6 +498,7 @@ snd_seq_oss_synth_sysex(struct seq_oss_devinfo *dp, int dev, unsigned char *buf,
	if (!info)
		return -ENXIO;

	guard(mutex)(&sysex_mutex);
	sysex = info->sysex;
	if (sysex == NULL) {
		sysex = kzalloc(sizeof(*sysex), GFP_KERNEL);