]> www.infradead.org Git - users/dwmw2/linux.git/commit
ALSA: pcm: Fix mutex unbalance in OSS emulation ioctls
authorTakashi Iwai <tiwai@suse.de>
Tue, 27 Mar 2018 12:32:23 +0000 (14:32 +0200)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:34 +0000 (21:36 -0400)
commite9650576c4414657d21d3e20b1bbfd03aae1d758
tree140dd469b0781f60e0e237a17259783f6806ed09
parent151fafd90c4390c42c6414ecea21bb612692c5e1
ALSA: pcm: Fix mutex unbalance in OSS emulation ioctls

[ Upstream commit f6d297df4dd47ef949540e4a201230d0c5308325 ]

The previous fix 40cab6e88cb0 ("ALSA: pcm: Return -EBUSY for OSS
ioctls changing busy streams") introduced some mutex unbalance; the
check of runtime->oss.rw_ref was inserted in a wrong place after the
mutex lock.

This patch fixes the inconsistency by rewriting with the helper
functions to lock/unlock parameters with the stream check.

Fixes: 40cab6e88cb0 ("ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
sound/core/oss/pcm_oss.c