]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-ioctl.c
[PATCH] device-mapper dm-ioctl: missing put in table load error case
[linux-2.6-omap-h63xx.git] / drivers / md / dm-ioctl.c
index 200a0688f717c76759c1165cde20652ad14d07f7..a90b053368ee3948d49394fe9b4eae2a0c1fcdf2 100644 (file)
@@ -230,11 +230,20 @@ static int dm_hash_insert(const char *name, const char *uuid, struct mapped_devi
 
 static void __hash_remove(struct hash_cell *hc)
 {
+       struct dm_table *table;
+
        /* remove from the dev hash */
        list_del(&hc->uuid_list);
        list_del(&hc->name_list);
        unregister_with_devfs(hc);
        dm_set_mdptr(hc->md, NULL);
+
+       table = dm_get_table(hc->md);
+       if (table) {
+               dm_table_event(table);
+               dm_table_put(table);
+       }
+
        dm_put(hc->md);
        if (hc->new_map)
                dm_table_put(hc->new_map);
@@ -965,6 +974,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size)
        if (!hc) {
                DMWARN("device doesn't appear to be in the dev hash table.");
                up_write(&_hash_lock);
+               dm_table_put(t);
                return -ENXIO;
        }