]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
mm/cma_debug.c: fix the break condition in cma_maxchunk_get()
authorYue Hu <huyue2@yulong.com>
Tue, 14 May 2019 00:16:37 +0000 (17:16 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit7add4839a13cdb8277c10dfee3f974f5641cf67d
treec3cf9b34587adeffe81511185ceab182a1e9cb31
parenta94b20c5ee02bb0b8a07b8ce94d9854120f7e82a
mm/cma_debug.c: fix the break condition in cma_maxchunk_get()

BugLink: https://bugs.launchpad.net/bugs/1838824
[ Upstream commit f0fd50504a54f5548eb666dc16ddf8394e44e4b7 ]

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.

Link: http://lkml.kernel.org/r/20190319092734.276-1-zbestahu@gmail.com
Signed-off-by: Yue Hu <huyue2@yulong.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Joe Perches <joe@perches.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dmitry Safonov <d.safonov@partner.samsung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
mm/cma_debug.c