Re: [PATCH 1/2] mm/zsmalloc.c: check encoded object value overflow for PAE

From: Sergey Senozhatsky
Date: Thu Oct 25 2018 - 01:29:20 EST


On (10/24/18 22:27), Rafael David Tinoco wrote:
> static unsigned long location_to_obj(struct page *page, unsigned int obj_idx)
> {
> - unsigned long obj;
> + unsigned long obj, pfn;
> +
> + pfn = page_to_pfn(page);
> +
> + if (unlikely(OBJ_OVERFLOW(pfn)))
> + BUG();

The trend these days is to have less BUG/BUG_ON-s in the kernel.

-ss