Commit c308cc50 authored by Joe Thornber's avatar Joe Thornber Committed by Greg Kroah-Hartman

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

[From Patrick Caulfield]
parent ee3a7e26
......@@ -109,9 +109,10 @@ int dm_register_target(struct target_type *t)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment