linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [bug report] Merge branch 'akpm-current/current'
@ 2021-08-11  8:06 Dan Carpenter
  2021-08-11  8:13 ` Feng Tang
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-11  8:06 UTC (permalink / raw)
  To: sfr; +Cc: linux-mm, Ben Widawsky

[ 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] Merge branch 'akpm-current/current'
  2021-08-11  8:06 [bug report] Merge branch 'akpm-current/current' Dan Carpenter
@ 2021-08-11  8:13 ` Feng Tang
  0 siblings, 0 replies; 2+ messages in thread
From: Feng Tang @ 2021-08-11  8:13 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: sfr, linux-mm, Widawsky, Ben

Hi Dan,

On Wed, Aug 11, 2021 at 04:06:00PM +0800, Dan Carpenter wrote:
> [ 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;"

Thanks for the report! This was also reported by Nathan Chancellor,
who gave a quick fix: https://lore.kernel.org/lkml/20210810200632.3812797-1-nathan@kernel.org/
and Andrew has taken it to the -mm tree.

Sorry for the inconvenience.

- Feng


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-11  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11  8:06 [bug report] Merge branch 'akpm-current/current' Dan Carpenter
2021-08-11  8:13 ` Feng Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).