Platform: OLPC: Fix memleak in olpc_ec_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sun, 23 Aug 2020 11:12:11 +0000 (19:12 +0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 24 Sep 2020 09:40:30 +0000 (12:40 +0300)
commit4fd9ac6bd3044734a7028bd993944c3617d1eede
treef930ad3d1ca380ed13193aee4b3d30a728249ba4
parent9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
Platform: OLPC: Fix memleak in olpc_ec_probe

When devm_regulator_register() fails, ec should be
freed just like when olpc_ec_cmd() fails.

Fixes: 231c0c216172a ("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>
drivers/platform/olpc/olpc-ec.c