From: Julia Lawall <julia.lawall@inria.fr>
To: Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@perex.cz>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:pending-fixes 241/297] sound/core/oss/mixer_oss.c:300:1-11: second lock on line 316 (fwd)
Date: Sun, 24 Oct 2021 18:54:52 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.22.394.2110241854060.2997@hadrien> (raw)
[-- Attachment #1: Type: text/plain, Size: 3460 bytes --]
Line 316 needs to be an unlock.
julia
---------- Forwarded message ----------
Date: Sun, 24 Oct 2021 22:51:40 +0800
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Cc: lkp@intel.com, Julia Lawall <julia.lawall@lip6.fr>
Subject: [linux-next:pending-fixes 241/297] sound/core/oss/mixer_oss.c:300:1-11:
second lock on line 316
CC: kbuild-all@lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Takashi Iwai <tiwai@suse.de>
CC: Jaroslav Kysela <perex@perex.cz>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git pending-fixes
head: 9344874edebc5f4360a045cdef5e4ab3cf42e5bd
commit: 411cef6adfb38a5bb6bd9af3941b28198e7fb680 [241/297] ALSA: mixer: oss: Fix racy access to slots
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> sound/core/oss/mixer_oss.c:300:1-11: second lock on line 316
vim +300 sound/core/oss/mixer_oss.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 290
f956b4a3ae790e Takashi Iwai 2005-11-17 291 static int snd_mixer_oss_set_volume(struct snd_mixer_oss_file *fmixer,
^1da177e4c3f41 Linus Torvalds 2005-04-16 292 int slot, int volume)
^1da177e4c3f41 Linus Torvalds 2005-04-16 293 {
f956b4a3ae790e Takashi Iwai 2005-11-17 294 struct snd_mixer_oss *mixer = fmixer->mixer;
f956b4a3ae790e Takashi Iwai 2005-11-17 295 struct snd_mixer_oss_slot *pslot;
^1da177e4c3f41 Linus Torvalds 2005-04-16 296 int result = 0, left = volume & 0xff, right = (volume >> 8) & 0xff;
^1da177e4c3f41 Linus Torvalds 2005-04-16 297
^1da177e4c3f41 Linus Torvalds 2005-04-16 298 if (mixer == NULL || slot > 30)
^1da177e4c3f41 Linus Torvalds 2005-04-16 299 return -EIO;
411cef6adfb38a Takashi Iwai 2021-10-20 @300 mutex_lock(&mixer->reg_mutex);
^1da177e4c3f41 Linus Torvalds 2005-04-16 301 pslot = &mixer->slots[slot];
^1da177e4c3f41 Linus Torvalds 2005-04-16 302 if (left > 100)
^1da177e4c3f41 Linus Torvalds 2005-04-16 303 left = 100;
^1da177e4c3f41 Linus Torvalds 2005-04-16 304 if (right > 100)
^1da177e4c3f41 Linus Torvalds 2005-04-16 305 right = 100;
^1da177e4c3f41 Linus Torvalds 2005-04-16 306 if (!pslot->stereo)
^1da177e4c3f41 Linus Torvalds 2005-04-16 307 right = left;
^1da177e4c3f41 Linus Torvalds 2005-04-16 308 if (pslot->put_volume)
^1da177e4c3f41 Linus Torvalds 2005-04-16 309 result = pslot->put_volume(fmixer, pslot, left, right);
^1da177e4c3f41 Linus Torvalds 2005-04-16 310 if (result < 0)
411cef6adfb38a Takashi Iwai 2021-10-20 311 goto unlock;
^1da177e4c3f41 Linus Torvalds 2005-04-16 312 pslot->volume[0] = left;
^1da177e4c3f41 Linus Torvalds 2005-04-16 313 pslot->volume[1] = right;
411cef6adfb38a Takashi Iwai 2021-10-20 314 result = (left & 0xff) | ((right & 0xff) << 8);
411cef6adfb38a Takashi Iwai 2021-10-20 315 unlock:
411cef6adfb38a Takashi Iwai 2021-10-20 @316 mutex_lock(&mixer->reg_mutex);
411cef6adfb38a Takashi Iwai 2021-10-20 317 return result;
^1da177e4c3f41 Linus Torvalds 2005-04-16 318 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 319
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: Type: application/gzip, Size: 79206 bytes --]
next reply other threads:[~2021-10-24 16:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-24 16:54 Julia Lawall [this message]
2021-10-26 6:27 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.22.394.2110241854060.2997@hadrien \
--to=julia.lawall@inria.fr \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox