[PATCH] kexec: fix mem_regions_sort()

Pratyush Anand panand at redhat.com
Wed Jul 27 10:52:24 PDT 2016


Missed CCing Russell because of --suppress-cc :(

CCing now.

On Wed, Jul 27, 2016 at 11:19 PM, Pratyush Anand <panand at redhat.com> wrote:
> ranges->ranges is  "struct memory_range *", however each element which need
> to be sorted is of type "struct memory_range". So, correct "size" argument
> of qsort() as sizeof(*ranges->ranges).
>
> Signed-off-by: Pratyush Anand <panand at redhat.com>
> Cc:Russell King <rmk at arm.linux.org.uk>
> Cc:Simon Horman <horms at verge.net.au>
> ---
>  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 e61c07472f1b..50c8abccb93a 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),
>               mem_range_cmp);
>  }
>
> --
> 2.5.5
>



More information about the kexec mailing list