Skip to content

Commit

Permalink
Add a WARN_ON to help spot vmalloc weird behaviour. Will revert later.
Browse files Browse the repository at this point in the history
  • Loading branch information
polesapart committed Jun 17, 2020
1 parent 558c120 commit fc293cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,10 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
* Check also calculated address against the vstart,
* because it can be 0 because of big align request.
*/
if (addr + size > vend || addr < vstart)
if (addr + size > vend || addr < vstart) {
WARN_ON(addr < vstart);
goto overflow;

}
va->va_start = addr;
va->va_end = addr + size;
va->flags = 0;
Expand Down

0 comments on commit fc293cd

Please sign in to comment.