Skip to contentSkip to conversation

fs/jffs2/scan.c: Fix error-path leak

PATCH In review Amit Choudhary 2 participants 2 messages Mar 9, 2007 Journalling flash file system V2 (JFFS2)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/jffs2/scan.c: Fix error-path leak

Description: Fix error-path leak in function jffs2_scan_medium(), in file fs/jffs2/scan.c

fs/jffs2/scan.c +2 -0
index e241346..cd9ed6e 100644
@@ -130,6 +130,8 @@ #endif
 	if (jffs2_sum_active()) {
 		s = kmalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
 		if (!s) {
+			free(flashbuf);
+			flashbuf = NULL;
 			JFFS2_WARNING("Can't allocate memory for summary\n");
 			return -ENOMEM;
 		}
#1 lore raw

Please, do not forget look at MAINTAINERS and CC the maintainer. David is CCed.

Quoted 23 lines · Amit Choudhary

Description: Fix error-path leak in function jffs2_scan_medium(), in file fs/jffs2/scan.c

fs/jffs2/scan.c +2 -1
index e241346..cd9ed6e 100644
@@ -130,6 +130,8 @@ #endif
 	if (jffs2_sum_active()) {
 		s = kmalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
 		if (!s) {
+			free(flashbuf);
+			flashbuf = NULL;
 			JFFS2_WARNING("Can't allocate memory for summary\n");
 			return -ENOMEM;
 		}
-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)