[dm-devel] [PATCH] fix error cleanup in dm_create_persistent()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The error cleanup path following the bad: label is incorrect.
1. The original code tries to free callbacks when in fact there
   can never been callbacks allocated at this point.
2. The original code forgot to free the "area" space.
                                                                                
This was originally found by chrisw during code review.


diff -ur linux-2.6.7-rc2-udm2-original/drivers/md/dm-exception-store.c linux-2.6.7-rc2-udm2-patched/drivers/md/dm-exception-store.c
--- linux-2.6.7-rc2-udm2-original/drivers/md/dm-exception-store.c	2004-06-07 14:23:24.000000000 -0700
+++ linux-2.6.7-rc2-udm2-patched/drivers/md/dm-exception-store.c	2004-06-08 16:28:02.000000000 -0700
@@ -569,8 +569,8 @@
       bad:
 	dm_io_put(sectors_to_pages(chunk_size));
 	if (ps) {
-		if (ps->callbacks)
-			vfree(ps->callbacks);
+		if (ps->area)
+			free_area(ps);
 
 		kfree(ps);
 	}

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux