Re: [patch, -git] drivers/media build fix for modular builds

Andrew Morton
2008-04-30T11:42:16Z

On Wed, 30 Apr 2008 11:20:31 +0200 Mike Galbraith <efault@gmx.de> wrote:

> [ 16.299803] kernel BUG at kernel/module.c:784!
> [ 16.307170] invalid opcode: 0000 [1] SMP
> [ 16.314110] CPU 3
> [ 16.318911] Modules linked in: tuner(+) snd_hda_intel(+) saa7134(+) compat_ioctl32 firewire_ohci videodev snd_pcm firewire_core v4l1_compat v4l2_common snd_timer videobuf_dma_sg videobuf_core crc_itu_t snd_page_alloc snd_hwdep ir_kbd_i2c ohci1394 snd ir_common usb_storage rtc_cmos ieee1394 tveeprom rtc_core i2c_i801 button sr_mod intel_agp serio_raw e1000e iTCO_wdt i2c_core iTCO_vendor_support rtc_lib cdrom sg soundcore usbhid hid ff_memless ehci_hcd uhci_hcd sd_mod usbcore edd ext3 mbcache jbd fan ahci libata scsi_mod dock thermal processor
> [ 16.386303] Pid: 2239, comm: modprobe Not tainted 2.6.26-smp #1
> [ 16.395339] RIP: 0010:[<ffffffff80254714>] [<ffffffff80254714>] __symbol_put+0x22/0x31

Does this make it feel better?

--- a/drivers/media/video/tuner-core.c~a
+++ a/drivers/media/video/tuner-core.c
@@ -40,11 +40,11 @@
typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
if (__a) { \
__r = (int) __a(ARGS); \
+ symbol_put(FUNCTION); \
} else { \
printk(KERN_ERR "TUNER: Unable to find " \
"symbol "#FUNCTION"()\n"); \
} \
- symbol_put(FUNCTION); \
__r; \
})

_