linux/drivers/media/usb/dvb-usb
Frank Schaefer 2279948735 [media] af9005: fix kernel panic on init if compiled without IR
This patches fixes an ancient bug in the dvb_usb_af9005 driver, which
has been reported at least in the following threads:
https://lkml.org/lkml/2009/2/4/350
https://lkml.org/lkml/2014/9/18/558

If the driver is compiled in without any IR support (neither
DVB_USB_AF9005_REMOTE nor custom symbols), the symbol_request calls in
af9005_usb_module_init() return pointers != NULL although the IR
symbols are not available.

This leads to the following oops:
...
[    8.529751] usbcore: registered new interface driver dvb_usb_af9005
[    8.531584] BUG: unable to handle kernel paging request at 02e00000
[    8.533385] IP: [<7d9d67c6>] af9005_usb_module_init+0x6b/0x9d
[    8.535613] *pde = 00000000
[    8.536416] Oops: 0000 [#1] PREEMPT PREEMPT DEBUG_PAGEALLOCDEBUG_PAGEALLOC
[    8.537863] CPU: 0 PID: 1 Comm: swapper Not tainted 3.15.0-rc6-00151-ga5c075c #1
[    8.539827] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[    8.541519] task: 89c9a670 ti: 89c9c000 task.ti: 89c9c000
[    8.541519] EIP: 0060:[<7d9d67c6>] EFLAGS: 00010206 CPU: 0
[    8.541519] EIP is at af9005_usb_module_init+0x6b/0x9d
[    8.541519] EAX: 02e00000 EBX: 00000000 ECX: 00000006 EDX: 00000000
[    8.541519] ESI: 00000000 EDI: 7da33ec8 EBP: 89c9df30 ESP: 89c9df2c
[    8.541519]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
[    8.541519] CR0: 8005003b CR2: 02e00000 CR3: 05a54000 CR4: 00000690
[    8.541519] Stack:
[    8.541519]  7d9d675b 89c9df90 7d992a49 7d7d5914 89c9df4c 7be3a800 7d08c58c 8a4c3968
[    8.541519]  89c9df80 7be3a966 00000192 00000006 00000006 7d7d3ff4 8a4c397a 00000200
[    8.541519]  7d6b1280 8a4c3979 00000006 000009a6 7da32db8 b13eec81 00000006 000009a6
[    8.541519] Call Trace:
[    8.541519]  [<7d9d675b>] ? ttusb2_driver_init+0x16/0x16
[    8.541519]  [<7d992a49>] do_one_initcall+0x77/0x106
[    8.541519]  [<7be3a800>] ? parameqn+0x2/0x35
[    8.541519]  [<7be3a966>] ? parse_args+0x113/0x25c
[    8.541519]  [<7d992bc2>] kernel_init_freeable+0xea/0x167
[    8.541519]  [<7cf01070>] kernel_init+0x8/0xb8
[    8.541519]  [<7cf27ec0>] ret_from_kernel_thread+0x20/0x30
[    8.541519]  [<7cf01068>] ? rest_init+0x10c/0x10c
[    8.541519] Code: 08 c2 c7 05 44 ed f9 7d 00 00 e0 02 c7 05 40 ed f9 7d 00 00 e0 02 c7 05 3c ed f9 7d 00 00 e0 02 75 1f b8 00 00 e0 02 85 c0 74 16 <a1> 00 00 e0 02 c7 05 54 84 8e 7d 00 00 e0 02 a3 58 84 8e 7d eb
[    8.541519] EIP: [<7d9d67c6>] af9005_usb_module_init+0x6b/0x9d SS:ESP 0068:89c9df2c
[    8.541519] CR2: 0000000002e00000
[    8.541519] ---[ end trace 768b6faf51370fc7 ]---

The prefered fix would be to convert the whole IR code to use the kernel IR
infrastructure (which wasn't available at the time this driver had been created).

Until anyone who still has this old hardware steps up an does the conversion,
fix it by not calling the symbol_request calls if the driver is compiled in
without the default IR symbols (CONFIG_DVB_USB_AF9005_REMOTE).
Due to the IR related pointers beeing NULL by default, IR support will then be disabled.

The downside of this solution is, that it will no longer be possible to
compile custom IR symbols (not using CONFIG_DVB_USB_AF9005_REMOTE) in.

Please note that this patch has NOT been tested with all possible cases.
I don't have the hardware and could only verify that it fixes the reported
bug.

Reported-by: Fengguag Wu <fengguang.wu@intel.com>
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: <stable@vger.kernel.org>
Acked-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 16:57:19 -02:00
..
Kconfig [media] cxusb: Add support for TechnoTrend TT-connect CT2-4650 CI 2014-09-02 15:12:38 -03:00
Makefile [media] Fix some Makefile rules 2012-08-16 19:55:03 -03:00
a800.c [media] dvb-usb: print small buffers via %*ph 2012-10-06 12:25:49 -03:00
af9005-fe.c
af9005-remote.c
af9005-script.h
af9005.c [media] af9005: fix kernel panic on init if compiled without IR 2014-10-30 16:57:19 -02:00
af9005.h
az6027.c [media] az6027: Added the PID for a new revision of the Elgato EyeTV Sat DVB-S Tuner 2014-05-25 15:49:35 -03:00
az6027.h
cinergyT2-core.c [media] dvb-usb: print small buffers via %*ph 2012-10-06 12:25:49 -03:00
cinergyT2-fe.c [media] dvb-usb: Remove redundant NULL check before kfree 2013-03-18 17:05:17 -03:00
cinergyT2.h
cxusb.c [media] cxusb: fix sparse warning 2014-09-03 10:33:20 -03:00
cxusb.h [media] cxusb: Add support for TechnoTrend TT-connect CT2-4650 CI 2014-09-02 15:12:38 -03:00
dib07x0.h
dib0700.h [media] dib0700: fix RC support on Hauppauge Nova-TD 2014-05-25 17:44:19 -03:00
dib0700_core.c [media] rc-core: document the protocol type 2014-07-23 21:50:48 -03:00
dib0700_devices.c [media] dib0700_devices: Use c99 initializers for structures. 2014-09-22 19:00:28 -03:00
dibusb-common.c [media] dibusb: fix sparse warnings 2014-09-03 09:23:31 -03:00
dibusb-mb.c
dibusb-mc.c
dibusb.h [media] Fix typo in comments 2014-07-26 15:09:47 -03:00
digitv.c [media] dvb-usb: print small buffers via %*ph 2012-10-06 12:25:49 -03:00
digitv.h
dtt200u-fe.c
dtt200u.c [media] dvb-usb: print small buffers via %*ph 2012-10-06 12:25:49 -03:00
dtt200u.h
dtv5100.c
dtv5100.h
dvb-usb-common.h
dvb-usb-dvb.c
dvb-usb-firmware.c
dvb-usb-i2c.c
dvb-usb-init.c [media] dvb-usb: fix indentation of a for loop 2012-12-27 16:26:13 -02:00
dvb-usb-remote.c [media] rc-core: remove protocol arrays 2014-07-25 19:10:43 -03:00
dvb-usb-urb.c
dvb-usb.h [media] rc-core: add separate defines for protocol bitmaps and numbers 2012-10-27 11:49:51 -02:00
dw2102.c [media] dw2102: fix sparse warnings 2014-09-03 09:31:31 -03:00
dw2102.h
friio-fe.c [media] dvb-usb/friio-fe: Replace memcpy with struct assignment 2012-12-27 18:48:52 -02:00
friio.c
friio.h
gp8psk-fe.c
gp8psk.c
gp8psk.h
m920x.c [media] rc-core: document the protocol type 2014-07-23 21:50:48 -03:00
m920x.h
nova-t-usb2.c
opera1.c [media] opera1: fix sparse warnings 2014-09-03 09:32:15 -03:00
pctv452e.c [media] pctv452e: fix sparse warnings 2014-09-03 09:32:42 -03:00
technisat-usb2.c [media] technisat-sub2: Fix stream curruption on high bitrate 2014-06-26 09:20:18 -03:00
ttusb2.c [media] rc-core: document the protocol type 2014-07-23 21:50:48 -03:00
ttusb2.h
umt-010.c
usb-urb.c
vp702x-fe.c
vp702x.c [media] vp702x: get rid of warning: no previous prototype 2012-10-27 18:14:14 -02:00
vp702x.h
vp7045-fe.c
vp7045.c
vp7045.h