linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/cma_debug.c: fix the break condition in cma_maxchunk_get()
@ 2019-03-19  9:27 Yue Hu
  0 siblings, 0 replies; only message in thread
From: Yue Hu @ 2019-03-19  9:27 UTC (permalink / raw)
  To: akpm, mhocko, joe, rientjes; +Cc: linux-mm, huyue2, dongjian

From: Yue Hu <huyue2@yulong.com>

If not find zero bit in find_next_zero_bit(), it will return the
size parameter passed in, so the start bit should be compared with
bitmap_maxno rather than cma->count. Although getting maxchunk is
working fine due to zero value of order_per_bit currently, the
operation will be stuck if order_per_bit is set as non-zero.

Signed-off-by: Yue Hu <huyue2@yulong.com>
---
 mm/cma_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/cma_debug.c b/mm/cma_debug.c
index f234672..3b69248 100644
--- a/mm/cma_debug.c
+++ b/mm/cma_debug.c
@@ -58,7 +58,7 @@ static int cma_maxchunk_get(void *data, u64 *val)
 	mutex_lock(&cma->lock);
 	for (;;) {
 		start = find_next_zero_bit(cma->bitmap, bitmap_maxno, end);
-		if (start >= cma->count)
+		if (start >= bitmap_maxno)
 			break;
 		end = find_next_bit(cma->bitmap, bitmap_maxno, start);
 		maxchunk = max(end - start, maxchunk);
-- 
1.9.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-19  9:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19  9:27 [PATCH] mm/cma_debug.c: fix the break condition in cma_maxchunk_get() Yue Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox