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:
parent
0a68a16b91
commit
b97c46ecaf
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user