Skip to contentSkip to conversation

ext4: minor fix in jbd2 stats kmalloc failure case

PATCH In review Eric Sandeen 2 participants 2 messages Dec 3, 2007 – Dec 4, 2007 Journalling layer for block devices (JBD2)

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 ext4: minor fix in jbd2 stats kmalloc failure case

(Mingming: these 4 patches can apply after jbd-stats-through-procfs-with-external-journal-oops-fix.patch)

---------------------------------------------------------------------

The other instance of this problem was caught, but this one got missed:
Free the correct pointer on s->stats allocation failure in jbd2_seq_info_open

---

fs/jbd2/journal.c +1 -1
Index: linux-2.6.24-rc3/fs/jbd2/journal.c
===================================================================
@@ -850,7 +850,7 @@ static int jbd2_seq_info_open(struct ino
 		return -EIO;
 	size = sizeof(struct transaction_stats_s);
 	s->stats = kmalloc(size, GFP_KERNEL);
-	if (s == NULL) {
+	if (s->stats == NULL) {
 		kfree(s);
 		return -EIO;
 	}
#1 lore raw
Quoted 3 lines · Eric Sandeen

(Mingming: these 4 patches can apply after jbd-stats-through-procfs-with-external-journal-oops-fix.patch)

Thanks Eric, looks all good to me. Updated the patch queue with the four jbd2 stats fixes from you.

Mingming