[bug report] Merge branch 'akpm-current/current'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ I do a git show 2db9f815409f and it doesn't show that hugetlb.c was
  modified but it the git log the merge commit is listed.  I don't
  know git well enough to explain it.  But I think this was a merge
  issue.  - dan ]

Hello Stephen Rothwell,

The patch 2db9f815409f: "Merge branch 'akpm-current/current'" from
Aug 10, 2021, leads to the following
Smatch static checker warning:

	mm/hugetlb.c:2172 alloc_buddy_huge_page_with_mpol()
	error: uninitialized symbol 'page'.

mm/hugetlb.c
    2151 static
    2152 struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h,
    2153 		struct vm_area_struct *vma, unsigned long addr)
    2154 {
    2155 	struct page *page;

This should be "struct page *page = NULL;"


    2156 	struct mempolicy *mpol;
    2157 	gfp_t gfp_mask = htlb_alloc_mask(h);
    2158 	int nid;
    2159 	nodemask_t *nodemask;
    2160 
    2161 	nid = huge_node(vma, addr, gfp_mask, &mpol, &nodemask);
    2162 	if (mpol_is_preferred_many(mpol)) {
    2163 		gfp_t gfp = gfp_mask | __GFP_NOWARN;
    2164 
    2165 		gfp &=  ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL);
    2166 		page = alloc_surplus_huge_page(h, gfp, nid, nodemask, false);
    2167 
    2168 		/* Fallback to all nodes if page==NULL */
    2169 		nodemask = NULL;
    2170 	}
    2171 
--> 2172 	if (!page)
    2173 		page = alloc_surplus_huge_page(h, gfp_mask, nid, nodemask, false);
    2174 	mpol_cond_put(mpol);
    2175 	return page;
    2176 }

regards,
dan carpenter




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux