From 50fc08f8c023d1e698207342e003f1b6d4bca1f5 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Thu, 13 Nov 2014 18:14:32 +0530 Subject: [PATCH] greybus: manifest: don't free unallocated resources Signed-off-by: Viresh Kumar Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/manifest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/manifest.c b/drivers/staging/greybus/manifest.c index 964f85ed603c..777abf400325 100644 --- a/drivers/staging/greybus/manifest.c +++ b/drivers/staging/greybus/manifest.c @@ -268,7 +268,7 @@ static bool gb_manifest_parse_module(struct gb_module *gmod, gmod->product_string = gb_string_get(desc_module->product_stringid); if (IS_ERR(gmod->product_string)) { - goto out_err; + goto out_free_vendor_string; } gmod->vendor = le16_to_cpu(desc_module->vendor); @@ -289,6 +289,7 @@ static bool gb_manifest_parse_module(struct gb_module *gmod, out_err: kfree(gmod->product_string); gmod->product_string = NULL; +out_free_vendor_string: kfree(gmod->vendor_string); gmod->vendor_string = NULL;