On 09/09/2023 22:16, Mukesh Ojha wrote:
> Register all the pstore frontend with minidump, so that they can
> be dumped as default Linux minidump region to be collected on
> SoC where minidump is enabled.
> 

...

> +
> +     record.type = type;
> +     record.id = 0;
> +     max_dump_cnt = 0;
> +     name = pstore_type_to_name(record.type);
> +     do {
> +             ret = pstore_region_defined(&record, &virt, &phys, &size, 
> &max_dump_cnt);
> +             if (ret < 0)
> +                     break;
> +
> +             mdr_list = devm_kzalloc(dev, sizeof(struct md_region_list), 
> GFP_KERNEL);

sizeof(*)

Please fix it everywhere in your code.

> +             if (!mdr_list)
> +                     return -ENOMEM;
> +
> +             md_region = &mdr_list->md_region;
> +             scnprintf(md_region->name, sizeof(md_region->name) - 1, 
> "K%s%llu", name, record.id);
> +             md_region->virt_addr = virt;
> +             md_region->phys_addr = phys;
> +             md_region->size = size;
> +             ret = qcom_minidump_region_register(md_region);
> +             if (ret) {
> +                     pr_err("failed to register minidump region\n");
> +                     break;
> +             }
> +
> +             list_add(&mdr_list->list, &ramoops_region_list);
> +     } while (record.id < max_dump_cnt && ++record.id);
> +
> +     return ret;
> +}


Best regards,
Krzysztof

Reply via email to