greybus: interface: free resources properly on failures
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 13 Nov 2014 12:44:38 +0000 (18:14 +0530)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 14 Nov 2014 21:18:26 +0000 (13:18 -0800)
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/interface.c

index f7f9bfda4f9b59d2f3d8d1846abf4e0ab34582f7..537ef80a599a7409fb5ed01891de8e8813810429 100644 (file)
@@ -79,6 +79,7 @@ gb_interface_create(struct gb_module *gmod, u8 interface_id)
        if (retval) {
                pr_err("failed to add interface device for id 0x%02hhx\n",
                        interface_id);
+               put_device(&interface->dev);
                kfree(interface);
                return NULL;
        }