linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata kfree fix
@ 2005-02-21 22:27 Jeff Garzik
  0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2005-02-21 22:27 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: linux-ide@vger.kernel.org, Linux Kernel

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

Fixes double-kfree that caused slab corruption.

Signed-off-by: Jeff Garzik <jgarzik@pobox.com>

[-- Attachment #2: patch --]
[-- Type: text/plain, 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;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-21 22:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-21 22:27 [PATCH] libata kfree fix Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).