Skip to contentSkip to conversation

scsi/mvsas: Fix memeleak when remove mvsas.ko.

PATCH In review majianpeng 1 participant 2 messages Aug 1, 2012 – Oct 15, 2012 SCSI

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 1/1 scsi/mvsas: Fix memeleak when remove mvsas.ko.

unreferenced object 0xffff8800a83d6e80 (size 64):
comm "insmod", pid 10288, jiffies 4296886959 (age 662.587s) hex dump (first 32 bytes):

    01 04 01 00 00 00 00 00 00 00 a8 76 00 88 ff ff  ...........v....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff815dd941>] kmemleak_alloc+0x21/0x50
    [<ffffffff81110763>] __kmalloc+0x153/0x240
    [<ffffffffa007e7da>] 0xffffffffa007e7da
    [<ffffffffa007ee71>] 0xffffffffa007ee71
    [<ffffffff812a08a5>] pci_device_probe+0x75/0xa0
    [<ffffffff8139c1e7>] driver_probe_device+0x77/0x230
    [<ffffffff8139c43b>] __driver_attach+0x9b/0xa0
    [<ffffffff8139a6fe>] bus_for_each_dev+0x4e/0x80
    [<ffffffff8139bd59>] driver_attach+0x19/0x20
    [<ffffffff8139b900>] bus_add_driver+0x180/0x280
    [<ffffffff8139c945>] driver_register+0x75/0x150
    [<ffffffff812a0640>] __pci_register_driver+0x50/0xc0
    [<ffffffffa003f086>] 0xffffffffa003f086
    [<ffffffff810001ba>] do_one_initcall+0x3a/0x160
    [<ffffffff8108a744>] sys_init_module+0xb04/0x1d10
    [<ffffffff816005a2>] system_call_fastpath+0x16/0x1b
---
 drivers/scsi/mvsas/mv_init.c |    1 +
 1 file changed, 1 insertion(+)
drivers/scsi/mvsas/mv_init.c +1 -0
index cc59dff..cd9fc36 100644
@@ -671,6 +671,7 @@ static void __devexit mvs_pci_remove(struct pci_dev *pdev)
 	}
 	kfree(sha->sas_phy);
 	kfree(sha->sas_port);
+	kfree(sha->lldd_ha);
 	kfree(sha);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
Signature · 1 line
1.7.9.5
#1 lore raw

On 2012-08-01 18:21 majianpeng <[email protected]> Wrote:

Quoted 42 lines

unreferenced object 0xffff8800a83d6e80 (size 64):
comm "insmod", pid 10288, jiffies 4296886959 (age 662.587s) hex dump (first 32 bytes):

   01 04 01 00 00 00 00 00 00 00 a8 76 00 88 ff ff  ...........v....
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 backtrace:
   [<ffffffff815dd941>] kmemleak_alloc+0x21/0x50
   [<ffffffff81110763>] __kmalloc+0x153/0x240
   [<ffffffffa007e7da>] 0xffffffffa007e7da
   [<ffffffffa007ee71>] 0xffffffffa007ee71
   [<ffffffff812a08a5>] pci_device_probe+0x75/0xa0
   [<ffffffff8139c1e7>] driver_probe_device+0x77/0x230
   [<ffffffff8139c43b>] __driver_attach+0x9b/0xa0
   [<ffffffff8139a6fe>] bus_for_each_dev+0x4e/0x80
   [<ffffffff8139bd59>] driver_attach+0x19/0x20
   [<ffffffff8139b900>] bus_add_driver+0x180/0x280
   [<ffffffff8139c945>] driver_register+0x75/0x150
   [<ffffffff812a0640>] __pci_register_driver+0x50/0xc0
   [<ffffffffa003f086>] 0xffffffffa003f086
   [<ffffffff810001ba>] do_one_initcall+0x3a/0x160
   [<ffffffff8108a744>] sys_init_module+0xb04/0x1d10
   [<ffffffff816005a2>] system_call_fastpath+0x16/0x1b

---
drivers/scsi/mvsas/mv_init.c | 1 +

1 file changed, 1 insertion(+)
drivers/scsi/mvsas/mv_init.c +1 -0
index cc59dff..cd9fc36 100644
@@ -671,6 +671,7 @@ static void __devexit mvs_pci_remove(struct pci_dev *pdev)
 	}
 	kfree(sha->sas_phy);
 	kfree(sha->sas_port);
+	kfree(sha->lldd_ha);
 	kfree(sha);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
Signature · 1 line
1.7.9.5

Hi JBottomley,
How about this patch?

Thanks!
Jianpeng