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>
* 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);
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;
kfree(cxt->pstore.buf);
fail4:
cxt->pstore.bufsize = 0;
+fail5:
return err;
}