mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-14 06:35:12 +00:00
Platform: OLPC: Fix memleak in olpc_ec_probe
commit4fd9ac6bd3
upstream. When devm_regulator_register() fails, ec should be freed just like when olpc_ec_cmd() fails. Fixes:231c0c2161
("Platform: OLPC: Add a regulator for the DCON") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ce8432912f
commit
2293272345
1 changed files with 3 additions and 1 deletions
|
@ -439,7 +439,9 @@ static int olpc_ec_probe(struct platform_device *pdev)
|
|||
&config);
|
||||
if (IS_ERR(ec->dcon_rdev)) {
|
||||
dev_err(&pdev->dev, "failed to register DCON regulator\n");
|
||||
return PTR_ERR(ec->dcon_rdev);
|
||||
err = PTR_ERR(ec->dcon_rdev);
|
||||
kfree(ec);
|
||||
return err;
|
||||
}
|
||||
|
||||
ec->dbgfs_dir = olpc_ec_setup_debugfs();
|
||||
|
|
Loading…
Reference in a new issue