linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Weird code with change "mm/gup: clean up follow_pfn_pte() slightly"
@ 2022-02-03  6:27 Lukas Bulwahn
  2022-02-03  8:38 ` John Hubbard
  0 siblings, 1 reply; 9+ messages in thread
From: Lukas Bulwahn @ 2022-02-03  6:27 UTC (permalink / raw)
  To: Andrew Morton, John Hubbard, Linux Kernel Mailing List, Linux-MM
  Cc: Jason Gunthorpe, Peter Xu, Alex Williamson, Andrea Arcangeli,
	David Hildenbrand, Jan Kara, Jason Gunthorpe, Kirill A. Shutemov

Dear John,

Your change "mm/gup: clean up follow_pfn_pte() slightly" (see Link),
visible in linux-next as commit 05fef840b5c6 ("mm/gup: clean up
follow_pfn_pte() slightly"), is somehow weird.

In the new branch if (pages), you set page = ERR_PTR(-EFAULT) and goto
out. However, at the label out, the value of page is not used, but the
return uses the variables i and ret.

Static analysis tools, such as clang-analyzer, rightfully complain
about such weird code.

Maybe you can have another look at what you intended to set in the
branch of that commit or if you intend to jump to the label out?


Best regards,

Lukas

Link: https://lkml.kernel.org/r/20220201101108.306062-3-jhubbard@nvidia.com


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

end of thread, other threads:[~2022-02-04  1:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03  6:27 Weird code with change "mm/gup: clean up follow_pfn_pte() slightly" Lukas Bulwahn
2022-02-03  8:38 ` John Hubbard
2022-02-03 13:01   ` Jason Gunthorpe
2022-02-03 20:44     ` John Hubbard
2022-02-04  0:45       ` Jason Gunthorpe
2022-02-04  0:59         ` John Hubbard
2022-02-04  1:06           ` Jason Gunthorpe
2022-02-04  1:22             ` John Hubbard
2022-02-04  1:26               ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox