On 23/10/25 20:53, Jiri Bohac wrote:
On Thu, Oct 23, 2025 at 05:44:12PM +0530, Sourabh Jain wrote:
@@ -595,6 +602,13 @@ int get_crash_memory_ranges(struct crash_mem **mem_ranges)
        if (ret)
                goto out;
+ for (i = 0; i < crashk_cma_cnt; ++i) {
+               ret = crash_exclude_mem_range(tmem, crashk_cma_ranges[i].start,
+                                             crashk_cma_ranges[i].end);
+               if (ret)
+                       goto out;
+       }
+
I think the loop needs to check if tmem->nr_ranges == tmem->max_nr_ranges and
reallocate in each iteration, just like it's done when excluding the crashk_res
region above:

Yeah, nice catch. I thought it would get adjusted automatically, as it is
done in the add_mem_range function.

Thanks for the review. I will update the patch and send v3.

         /* Reallocate memory ranges if there is no space to split ranges */
         tmem = *mem_ranges;
         if (tmem && (tmem->nr_ranges == tmem->max_nr_ranges)) {
                 tmem = realloc_mem_ranges(mem_ranges);
                 if (!tmem)
                         goto out;
         }

         /* Exclude crashkernel region */
         ret = crash_exclude_mem_range(tmem, crashk_res.start, crashk_res.end);
         if (ret)
                 goto out;





Reply via email to