1
0
Fork 0

greybus: module: fix double freeing of module structure

The module will be released by gb_module_release() once all references
for the module are dropped. And so there is no need to free it in the
error path specially.

Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
hifive-unleashed-5.1
Viresh Kumar 2015-10-21 15:26:45 +05:30 committed by Greg Kroah-Hartman
parent 63e8a14b1f
commit f7d3ad9828
1 changed files with 0 additions and 1 deletions

View File

@ -151,7 +151,6 @@ struct gb_module *gb_module_create(struct device *parent, u8 module_id)
pr_err("failed to add module device for id 0x%02hhx\n",
module_id);
put_device(&module->dev);
kfree(module);
return NULL;
}