Fix missing dm_put().

There's an error path that fails to call dm_put(), which means bad
things happen.  This patch adds the dm_put() call.
This commit is contained in:
Peter Jones 2010-10-15 13:16:48 -04:00
parent c13cbf3b7d
commit 7810142e6c
1 changed files with 2 additions and 1 deletions

View File

@ -62,7 +62,7 @@ index bb6bdc8..d102269 100644
return -EBUSY;
}
@@ -329,22 +334,45 @@ static int dm_hash_rename(uint32_t cookie, uint32_t *flags, const char *old,
@@ -329,22 +334,46 @@ static int dm_hash_rename(uint32_t cookie, uint32_t *flags, const char *old,
*/
hc = __get_name_cell(old);
if (!hc) {
@ -92,6 +92,7 @@ index bb6bdc8..d102269 100644
+ DMWARN("Unable to change uuid of device, %s because "
+ "uuid is already set to %s",
+ old, hc->uuid);
+ dm_put(hc->md);
+ up_write(&_hash_lock);
+ kfree(new_data);
+ return -EINVAL;