]> git.itanic.dy.fi Git - linux-stable/commit
power: bq2415x_charger: Fix memory leak on DTS parsing error
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Wed, 15 Oct 2014 14:25:10 +0000 (16:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:13 +0000 (09:23 -0800)
commitea7179fc0157b82cf44ac9d1bb29a9bc5954f3aa
treeb49729a00800d714fed708ae11492af42c68a24b
parent6bee038ae16df1fc7cc82ae23808593f283c2521
power: bq2415x_charger: Fix memory leak on DTS parsing error

commit 21e863b233553998737e1b506c823a00bf012e00 upstream.

Memory allocated for 'name' was leaking if required binding properties
were not present.

The memory for 'name' was allocated early at probe with kasprintf(). It
was freed in error paths executed before and after parsing DTS but not
in that error path.

Fix the error path for parsing device tree properties.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: faffd234cf85 ("bq2415x_charger: Add DT support")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/bq2415x_charger.c