All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kexec: fix mem_regions_sort()
@ 2016-07-27 17:49 Pratyush Anand
  2016-07-27 17:52 ` Pratyush Anand
  0 siblings, 1 reply; 6+ messages in thread
From: Pratyush Anand @ 2016-07-27 17:49 UTC (permalink / raw)
  To: kexec

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@redhat.com>
Cc:Russell King <rmk@arm.linux.org.uk>
Cc:Simon Horman <horms@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


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-29  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-27 17:49 [PATCH] kexec: fix mem_regions_sort() Pratyush Anand
2016-07-27 17:52 ` Pratyush Anand
2016-07-28 14:38   ` Russell King
2016-07-29  3:52     ` Pratyush Anand
2016-08-09  3:25       ` Pratyush Anand
2016-09-29  7:47       ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.