linux/drivers/media/pci/ivtv
Takashi Iwai deb29e9022 [media] ivtv: Fix Oops when no firmware is loaded
When ivtv PCM device is accessed at the state where no firmware is
loaded, it oopses like:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
  IP: [<ffffffffa049a881>] try_mailbox.isra.0+0x11/0x50 [ivtv]
  Call Trace:
    [<ffffffffa049aa20>] ivtv_api_call+0x160/0x6b0 [ivtv]
    [<ffffffffa049af86>] ivtv_api+0x16/0x40 [ivtv]
    [<ffffffffa049b10c>] ivtv_vapi+0xac/0xc0 [ivtv]
    [<ffffffffa049d40d>] ivtv_start_v4l2_encode_stream+0x19d/0x630 [ivtv]
    [<ffffffffa0530653>] snd_ivtv_pcm_capture_open+0x173/0x1c0 [ivtv_alsa]
    [<ffffffffa04526f1>] snd_pcm_open_substream+0x51/0x100 [snd_pcm]
    [<ffffffffa0452853>] snd_pcm_open+0xb3/0x260 [snd_pcm]
    [<ffffffffa0452a37>] snd_pcm_capture_open+0x37/0x50 [snd_pcm]
    [<ffffffffa033f557>] snd_open+0xa7/0x1e0 [snd]
    [<ffffffff8118a628>] chrdev_open+0x88/0x1d0
    [<ffffffff811840be>] do_dentry_open+0x1de/0x270
    [<ffffffff81193a73>] do_last+0x1c3/0xec0
    [<ffffffff81194826>] path_openat+0xb6/0x670
    [<ffffffff81195b65>] do_filp_open+0x35/0x80
    [<ffffffff81185449>] do_sys_open+0x129/0x210
    [<ffffffff815b782d>] system_call_fastpath+0x1a/0x1f

This patch adds the check of firmware at PCM open callback like other
open callbacks of this driver.

Bugzilla: https://apibugzilla.novell.com/show_bug.cgi?id=875440

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 12:21:39 -03:00
..
ivtv-alsa-main.c [media] Convert to snd_card_new() with a device pointer 2014-02-14 08:14:09 +01:00
ivtv-alsa-mixer.c [media] ivtv, ivtv-alsa: Add initial ivtv-alsa interface driver for ivtv 2012-09-18 13:26:50 -03:00
ivtv-alsa-mixer.h [media] ivtv, ivtv-alsa: Add initial ivtv-alsa interface driver for ivtv 2012-09-18 13:26:50 -03:00
ivtv-alsa-pcm.c [media] ivtv: Fix Oops when no firmware is loaded 2014-05-23 12:21:39 -03:00
ivtv-alsa-pcm.h [media] cx18/ivtv: fix regression: remove __init from a non-init function 2013-02-11 18:18:14 -02:00
ivtv-alsa.h [media] ivtv, ivtv-alsa: Add initial ivtv-alsa interface driver for ivtv 2012-09-18 13:26:50 -03:00
ivtv-cards.c
ivtv-cards.h
ivtv-controls.c
ivtv-controls.h
ivtv-driver.c [media] ivtv: remove deprecated IRQF_DISABLED 2013-10-17 06:08:52 -03:00
ivtv-driver.h [media] ivtv-alsa, ivtv: Connect ivtv PCM capture stream to ivtv-alsa interface driver 2012-09-18 13:29:07 -03:00
ivtv-fileops.c [media] ivtv: fix v4l2-compliance errors for the radio device 2012-10-01 17:14:27 -03:00
ivtv-fileops.h [media] ivtv, ivtv-alsa: Add initial ivtv-alsa interface driver for ivtv 2012-09-18 13:26:50 -03:00
ivtv-firmware.c [media] v4l2: pass std by value to the write-only s_std ioctl 2013-03-24 06:47:00 -03:00
ivtv-firmware.h
ivtv-gpio.c [media] v4l2: add const to argument of write-only s_tuner ioctl 2013-03-24 06:31:23 -03:00
ivtv-gpio.h
ivtv-i2c.c [media] media: cx18, ivtv: eliminate unnecessary array index checks 2013-02-05 19:19:44 -02:00
ivtv-i2c.h
ivtv-ioctl.c [media] ivtv: fix register range check 2013-06-17 09:17:27 -03:00
ivtv-ioctl.h [media] v4l2: pass std by value to the write-only s_std ioctl 2013-03-24 06:47:00 -03:00
ivtv-irq.c [media] ivtv-alsa, ivtv: Connect ivtv PCM capture stream to ivtv-alsa interface driver 2012-09-18 13:29:07 -03:00
ivtv-irq.h
ivtv-mailbox.c
ivtv-mailbox.h
ivtv-queue.c
ivtv-queue.h
ivtv-routing.c
ivtv-routing.h
ivtv-streams.c [media] ivtv: disable a bunch of ioctls that are invalid for the decoder VBI 2012-10-01 17:23:24 -03:00
ivtv-streams.h
ivtv-udma.c
ivtv-udma.h
ivtv-vbi.c [media] drivers/media/pci: use memmove for overlapping regions 2013-02-05 19:26:38 -02:00
ivtv-vbi.h
ivtv-version.h
ivtv-yuv.c
ivtv-yuv.h
ivtvfb.c [media] media: ivtv: Remove redundant NULL check before kfree 2013-03-18 17:04:37 -03:00
Kconfig [media] ivtv-alsa: Remove EXPERIMENTAL from Kconfig and revise Kconfig help text 2012-09-18 15:34:59 -03:00
Makefile [media] ivtv, ivtv-alsa: Add initial ivtv-alsa interface driver for ivtv 2012-09-18 13:26:50 -03:00