Skip to content
Commit dafa724b authored by tang.junhui's avatar tang.junhui Committed by Mike Snitzer
Browse files

dm table: fix missing dm_put_target_type() in dm_table_add_target()



dm_get_target_type() was previously called so any error returned from
dm_table_add_target() must first call dm_put_target_type().  Otherwise
the DM target module's reference count will leak and the associated
kernel module will be unable to be removed.

Also, leverage the fact that r is already -EINVAL and remove an extra
newline.

Fixes: 36a0456f ("dm table: add immutable feature")
Fixes: cc6cbe14 ("dm table: add always writeable feature")
Fixes: 3791e2fc ("dm table: add singleton feature")
Cc: stable@vger.kernel.org # 3.2+
Signed-off-by: default avatartang.junhui <tang.junhui@zte.com.cn>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 937fa62e
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