soc: samsung: chipid: Fix memory leak in error path
authorColin Ian King <colin.king@canonical.com>
Fri, 16 Aug 2019 22:21:51 +0000 (23:21 +0100)
committerKrzysztof Kozlowski <krzk@kernel.org>
Mon, 19 Aug 2019 17:06:14 +0000 (19:06 +0200)
commit3636e82135ce5ade87c238e61a315df23dbcd4d6
treef39ab2413cb8ba8065533dc36b71345fbe17b717
parent40d8aff614f71ab3cab20785b4f213e3802d4e87
soc: samsung: chipid: Fix memory leak in error path

Currently when the call to product_id_to_soc_id fails there
is a memory leak of soc_dev_attr->revision and soc_dev_attr
on the error return path.  Fix this by adding a common error
return path that frees there obects and use this for two
error return paths.

Addresses-Coverity: ("Resource leak")
Fixes: 3253b7b7cd44 ("soc: samsung: Add exynos chipid driver support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
drivers/soc/samsung/exynos-chipid.c