The patch titled i5000-edac: hold reference to mci kobject has been added to the -mm tree. Its filename is i5000-edac-hold-reference-to-mci-kobject.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: i5000-edac: hold reference to mci kobject From: "Darrick J. Wong" <djwong@xxxxxxxxxx> It turns out that edac_mc_del_mc will kobject_put the last kref on the mci object. If the timing is just right, that means that the mci object is freed before before i5000_remove_one has a chance to free the resources associated with it, causing a null pointer exceptions when unloading the driver. Insert a kobject_{get,put} pair so that this doesn't happen. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> Cc: Doug Thompson <norsk5@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/edac/i5000_edac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/edac/i5000_edac.c~i5000-edac-hold-reference-to-mci-kobject drivers/edac/i5000_edac.c --- a/drivers/edac/i5000_edac.c~i5000-edac-hold-reference-to-mci-kobject +++ a/drivers/edac/i5000_edac.c @@ -1381,6 +1381,7 @@ static int i5000_probe1(struct pci_dev * if (mci == NULL) return -ENOMEM; + kobject_get(&mci->edac_mci_kobj); debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci); mci->dev = &pdev->dev; /* record ptr to the generic device */ @@ -1453,6 +1454,7 @@ fail1: i5000_put_devices(mci); fail0: + kobject_put(&mci->edac_mci_kobj); edac_mc_free(mci); return -ENODEV; } @@ -1498,7 +1500,7 @@ static void __devexit i5000_remove_one(s /* retrieve references to resources, and free those resources */ i5000_put_devices(mci); - + kobject_put(&mci->edac_mci_kobj); edac_mc_free(mci); } _ Patches currently in -mm which might be from djwong@xxxxxxxxxx are fix-platform-drivers-that-crash-on-suspend-resume.patch i5000-edac-hold-reference-to-mci-kobject.patch ibmpex-add-endian-annotation-to-extract_data-helper.patch adt7462-new-hwmon-driver.patch i5k_amb-load-automatically-on-all-5000-5400-chipsets.patch adt7470-check-input-range-when-sysfs-files-are-written.patch adt7473-check-inputs-from-sysfs-writes.patch lm85-support-adt7468-chips.patch ics932s401-new-driver.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html