CHROMIUM: ramoops: Fix some error handling goto's.
authorBryan Freed <bfreed@chromium.org>
Mon, 4 Jun 2012 22:08:45 +0000 (15:08 -0700)
committerGerrit <chrome-bot@google.com>
Sat, 21 Jul 2012 02:16:46 +0000 (19:16 -0700)
If we probe for a second ramoops device, still return an error, but do
not zero out the first device's bufsize.

BUG=chrome-os-partner:8931
TEST=Test with fdt and chromeos ramoops devices defined.

Change-Id: Idd509bf218f12280f863260fed9520766b096753
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26500
Reviewed-by: Olof Johansson <olofj@chromium.org>
drivers/char/ramoops.c

index 14feb04..bec4112 100644 (file)
@@ -188,12 +188,12 @@ static int __init ramoops_probe(struct platform_device *pdev)
         * probes.
         */
        if (cxt->max_count)
-               goto fail3;
+               goto fail5;
 
        if (!pdata->mem_size || !pdata->record_size) {
                pr_err("The memory size and the record size must be "
                        "non-zero\n");
-               goto fail3;
+               goto fail5;
        }
 
        pdata->mem_size = rounddown_pow_of_two(pdata->mem_size);
@@ -203,13 +203,13 @@ static int __init ramoops_probe(struct platform_device *pdev)
        if (pdata->mem_size < MIN_MEM_SIZE &&
                        pdata->record_size < MIN_MEM_SIZE) {
                pr_err("memory size too small, minium is %lu\n", MIN_MEM_SIZE);
-               goto fail3;
+               goto fail5;
        }
 
        if (pdata->mem_size < pdata->record_size) {
                pr_err("The memory size must be larger than the "
                        "records size\n");
-               goto fail3;
+               goto fail5;
        }
 
        cxt->max_count = pdata->mem_size / pdata->record_size;
@@ -255,6 +255,7 @@ fail3:
        kfree(cxt->pstore.buf);
 fail4:
        cxt->pstore.bufsize = 0;
+fail5:
        return err;
 }