]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
EDAC/igen6: Fix call trace due to missing release()
authorQiuxu Zhuo <qiuxu.zhuo@intel.com>
Fri, 3 Apr 2026 05:40:27 +0000 (13:40 +0800)
committerTony Luck <tony.luck@intel.com>
Fri, 29 May 2026 15:34:12 +0000 (08:34 -0700)
When unloading the igen6_edac driver, there is a call trace:

  Device '(null)' does not have a release() function, it is broken and must be fixed.
  See Documentation/core-api/kobject.rst.
  WARNING: drivers/base/core.c:2567 at device_release+0x84/0x90, CPU#5: rmmod/127209
  ...
  RIP: 0010:device_release+0x84/0x90
  Call Trace:
   <TASK>
   kobject_put+0x8c/0x220
   put_device+0x17/0x30
   igen6_unregister_mcis+0xa2/0xe0 [igen6_edac]
   igen6_remove+0x82/0xb0 [igen6_edac]
   ...

Fix the call trace by providing empty release() functions for the
memory controller devices.

Fixes: 10590a9d4f23 ("EDAC/igen6: Add EDAC driver for Intel client SoCs using IBECC")
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://patch.msgid.link/20260403054029.3950383-2-qiuxu.zhuo@intel.com
drivers/edac/igen6_edac.c

index fcb8ab44cba55b11f76f2ad2a54b1199b5c11ec0..0bf9cf349d0b4e41a0df77ce84897931810c834b 100644 (file)
@@ -1296,6 +1296,11 @@ static bool igen6_imc_absent(void __iomem *window)
        return readl(window + MAD_INTER_CHANNEL_OFFSET) == ~0;
 }
 
+static void imc_release(struct device *dev)
+{
+       /* Nothing to do, the 'imc' owns the 'dev' and will also release it. */
+}
+
 static int igen6_register_mci(int mc, void __iomem *window, struct pci_dev *pdev)
 {
        struct edac_mc_layer layers[2];
@@ -1334,6 +1339,7 @@ static int igen6_register_mci(int mc, void __iomem *window, struct pci_dev *pdev
        mci->pvt_info = &igen6_pvt->imc[mc];
 
        imc = mci->pvt_info;
+       imc->dev.release = imc_release;
        device_initialize(&imc->dev);
        /*
         * EDAC core uses mci->pdev(pointer of structure device) as