kernel-hacking-2024-linux-s.../drivers/edac
Mauro Carvalho Chehab accf74fff3 i7core_edac: don't use a freed mci struct
This is a nasty bug. Since kobject count will be reduced by zero by
edac_mc_del_mc(), and this triggers the kobj release method, the
mci memory will be freed automatically. So, all we have left is ctl_name,
as shown by enabling debug:

[   80.822186] EDAC DEBUG: in drivers/edac/edac_mc_sysfs.c, line at 1020: edac_remove_sysfs_mci_device()  remove_link
[   80.832590] EDAC DEBUG: in drivers/edac/edac_mc_sysfs.c, line at 1024: edac_remove_sysfs_mci_device()  remove_mci_instance
[   80.843776] EDAC DEBUG: in drivers/edac/edac_mc_sysfs.c, line at 640: edac_mci_control_release() mci instance idx=0 releasing
[   80.855163] EDAC MC: Removed device 0 for i7core_edac.c i7 core #0: DEV 0000:3f:03.0
[   80.862936] EDAC DEBUG: in drivers/edac/i7core_edac.c, line at 2089: (null): free structs
[   80.871134] EDAC DEBUG: in drivers/edac/edac_mc.c, line at 238: edac_mc_free()
[   80.878379] EDAC DEBUG: in drivers/edac/edac_mc_sysfs.c, line at 726: edac_mc_unregister_sysfs_main_kobj()
[   80.888043] EDAC DEBUG: in drivers/edac/i7core_edac.c, line at 1232: drivers/edac/i7core_edac.c: i7core_put_devices()

Also, kfree(mci) shouldn't happen at the kobj.release, as it happens
when edac_remove_sysfs_mci_device() is called, but the logic is:
	edac_remove_sysfs_mci_device(mci);
	edac_printk(KERN_INFO, EDAC_MC,
		"Removed device %d for %s %s: DEV %s\n", mci->mc_idx,
		mci->mod_name, mci->ctl_name, edac_dev_name(mci));
So, as the edac_printk() needs the mci struct, this generates an OOPS.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-24 11:20:38 -02:00
..
amd64_edac.c amd64_edac: Do not report error overflow as a separate error 2010-08-26 12:46:03 +02:00
amd64_edac.h
amd64_edac_dbg.c
amd64_edac_inj.c
amd76x_edac.c
amd8111_edac.c
amd8111_edac.h
amd8131_edac.c
amd8131_edac.h
cell_edac.c
cpc925_edac.c
e7xxx_edac.c
e752x_edac.c
edac_core.h i7core_edac: move #if PAGE_SHIFT to edac_core.h 2010-10-24 11:20:36 -02:00
edac_device.c
edac_device_sysfs.c
edac_mc.c i7core_edac: don't use a freed mci struct 2010-10-24 11:20:38 -02:00
edac_mc_sysfs.c i7core_edac: don't use a freed mci struct 2010-10-24 11:20:38 -02:00
edac_mce.c
edac_mce_amd.c amd64_edac: Do not report error overflow as a separate error 2010-08-26 12:46:03 +02:00
edac_mce_amd.h
edac_module.c
edac_module.h
edac_pci.c
edac_pci_sysfs.c
edac_stub.c
i7core_edac.c i7core_edac: don't use a freed mci struct 2010-10-24 11:20:38 -02:00
i3000_edac.c
i3200_edac.c
i5000_edac.c
i5100_edac.c
i5400_edac.c edac: i5400: improve handling of pci_enable_device() return value 2010-08-11 08:59:21 -07:00
i82443bxgx_edac.c
i82860_edac.c
i82875p_edac.c
i82975x_edac.c
Kconfig
Makefile
mpc85xx_edac.c Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-08-12 09:11:31 -07:00
mpc85xx_edac.h
mv64x60_edac.c
mv64x60_edac.h
pasemi_edac.c
ppc4xx_edac.c
ppc4xx_edac.h
r82600_edac.c
x38_edac.c