powerpc: Remove bootmem allocator

Dan Carpenter dan.carpenter at oracle.com
Wed Nov 12 21:02:03 AEDT 2014


Hello Anton Blanchard,

The patch 10239733ee86: "powerpc: Remove bootmem allocator" from Sep
17, 2014, leads to the following static checker warning:

	arch/powerpc/mm/pgtable_32.c:108 pte_alloc_one_kernel()
	warn: 'pte' can't be NULL.

arch/powerpc/mm/pgtable_32.c
    99  __init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
   100  {
   101          pte_t *pte;
   102          extern int mem_init_done;
   103  
   104          if (mem_init_done) {
   105                  pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
   106          } else {
   107                  pte = __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
   108                  if (pte)

It's complaining because we need to check the return from
memblock_alloc() instead of the return from __va().

   109                          clear_page(pte);
   110          }
   111          return pte;
   112  }

regards,
dan carpenter


More information about the Linuxppc-dev mailing list