staging: most: add missing call to ida_simple_remove
authorChristian Gromm <christian.gromm@microchip.com>
Tue, 22 Dec 2015 09:52:51 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 01:34:58 +0000 (17:34 -0800)
This patch adds two missing calls to function ida_simpel_remove.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/mostcore/core.c

index 8be6cdcf4008d7d780f8c5ac0b5f1ae05fe8c936..995987d352a8b95d1a837052d5b5bae9a0330a6d 100644 (file)
@@ -1752,6 +1752,7 @@ struct kobject *most_register_interface(struct most_interface *iface)
        inst = create_most_inst_obj(name);
        if (!inst) {
                pr_info("Failed to allocate interface instance\n");
+               ida_simple_remove(&mdev_id, id);
                return ERR_PTR(-ENOMEM);
        }
 
@@ -1808,6 +1809,7 @@ struct kobject *most_register_interface(struct most_interface *iface)
 free_instance:
        pr_info("Failed allocate channel(s)\n");
        list_del(&inst->list);
+       ida_simple_remove(&mdev_id, id);
        destroy_most_inst_obj(inst);
        return ERR_PTR(-ENOMEM);
 }