greybus: manifest: don't free unallocated resources
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 13 Nov 2014 12:44:32 +0000 (18:14 +0530)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 14 Nov 2014 21:16:05 +0000 (13:16 -0800)
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/manifest.c

index 964f85ed603cb7e8c825a955f8a94a5f977a55eb..777abf400325826a996c01747d52ddc88067b78d 100644 (file)
@@ -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;