[dm-devel] [PATCH] fix error cleanup in dm_create_persistent()
Dave Olien
dmo at osdl.org
Wed Jun 9 05:20:44 UTC 2004
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);
}
More information about the dm-devel
mailing list