The third argument of qsort() must be the size of each array element. Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org> --- kexec/mem_regions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec/mem_regions.c b/kexec/mem_regions.c index e61c074..a8cb510 100644 --- a/kexec/mem_regions.c +++ b/kexec/mem_regions.c @@ -24,7 +24,7 @@ static int mem_range_cmp(const void *a1, const void *a2) */ void mem_regions_sort(struct memory_ranges *ranges) { - qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges), + qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges[0]), mem_range_cmp); } -- 2.9.0