[PATCH 5/7] dm: Fix memory leak in dm_register_target()

Joe Thornber (thornber@sistina.com)
Mon, 9 Jun 2003 15:37:11 +0100


Fix memory leak in dm_register_target. [Patrick Caulfield]
--- diff/drivers/md/dm-target.c 2003-06-09 15:05:02.000000000 +0100
+++ source/drivers/md/dm-target.c 2003-06-09 15:05:18.000000000 +0100
@@ -109,9 +109,10 @@
return -ENOMEM;

down_write(&_lock);
- if (__find_target_type(t->name))
+ if (__find_target_type(t->name)) {
+ kfree(ti);
rv = -EEXIST;
- else
+ } else
list_add(&ti->list, &_targets);

up_write(&_lock);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/