greybus: interface: free resources properly on failures

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>
This commit is contained in:
Viresh Kumar 2014-11-13 18:14:38 +05:30 committed by Greg Kroah-Hartman
parent 0a68a16b91
commit b97c46ecaf

View 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;
}