[PATCH #2] Re: slab corruption on 2.6.10-rc4-bk7

Jeff Garzik
2005-02-21T04:35:42Z

[-- Attachment #1: Type: text/plain, Size: 41 bytes --]

Actually, here's a better fix.

Jeff

[-- Attachment #2: libata_probe_ent_free_fix.patch --]
[-- Type: text/x-patch, Size: 621 bytes --]

===== drivers/scsi/libata-core.c 1.116 vs edited =====
--- 1.116/drivers/scsi/libata-core.c 2005-02-01 20:23:51 -05:00
+++ edited/drivers/scsi/libata-core.c 2005-02-20 23:34:32 -05:00
@@ -2800,7 +2800,7 @@
return 1;

/* fall through */
-
+
default:
return 0;
}
@@ -3743,16 +3743,13 @@
if (legacy_mode) {
if (legacy_mode & (1 << 0))
ata_device_add(probe_ent);
- else
- kfree(probe_ent);
if (legacy_mode & (1 << 1))
ata_device_add(probe_ent2);
- else
- kfree(probe_ent2);
- } else {
+ } else
ata_device_add(probe_ent);
- }
+
kfree(probe_ent);
+ kfree(probe_ent2);

return 0;