Re: [PATCH] ivtv: Fix a sleep-in-atomic bug in snd_ivtv_pcm_hw_free

From: kbuild test robot
Date: Thu Jun 01 2017 - 01:54:14 EST


Hi Jia-Ju,

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.12-rc3 next-20170531]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Jia-Ju-Bai/ivtv-Fix-a-sleep-in-atomic-bug-in-snd_ivtv_pcm_hw_free/20170601-131112
base: git://linuxtv.org/media_tree.git master
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

drivers/media//pci/ivtv/ivtv-alsa-pcm.c: In function 'snd_ivtv_pcm_hw_free':
>> drivers/media//pci/ivtv/ivtv-alsa-pcm.c:274:2: warning: 'dma_area' may be used uninitialized in this function [-Wmaybe-uninitialized]
vfree(dma_area);
^

vim +/dma_area +274 drivers/media//pci/ivtv/ivtv-alsa-pcm.c

258 params_buffer_bytes(params));
259 }
260
261 static int snd_ivtv_pcm_hw_free(struct snd_pcm_substream *substream)
262 {
263 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream);
264 unsigned long flags;
265 unsigned char *dma_area;
266
267 spin_lock_irqsave(&itvsc->slock, flags);
268 if (substream->runtime->dma_area) {
269 dprintk("freeing pcm capture region\n");
270 dma_area = substream->runtime->dma_area;
271 substream->runtime->dma_area = NULL;
272 }
273 spin_unlock_irqrestore(&itvsc->slock, flags);
> 274 vfree(dma_area);
275
276 return 0;
277 }
278
279 static int snd_ivtv_pcm_prepare(struct snd_pcm_substream *substream)
280 {
281 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream);
282

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip