linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Resource Leak] Missing closing files in testing/selftests/vm/mlock2
@ 2021-12-30  3:17 Ryan Cai
  2021-12-30  3:51 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Cai @ 2021-12-30  3:17 UTC (permalink / raw)
  To: shuah, akpm; +Cc: linux-mm, linux-kselftest, linux-kernel

Dear Kernel maintainers,
              1. In testing/selftests/vm/mlock2, the file opened at Line 39 may not closed when going to Line 65.
              Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/tools/testing/selftests/vm/mlock2.h#L37-L49

              Can I send I a patch?

Best,
Ryan





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

* Re: [Resource Leak] Missing closing files in testing/selftests/vm/mlock2
  2021-12-30  3:17 [Resource Leak] Missing closing files in testing/selftests/vm/mlock2 Ryan Cai
@ 2021-12-30  3:51 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2021-12-30  3:51 UTC (permalink / raw)
  To: Ryan Cai; +Cc: shuah, linux-mm, linux-kselftest, linux-kernel

On Thu, 30 Dec 2021 11:17:37 +0800 Ryan Cai <ycaibb@gmail.com> wrote:

> Dear Kernel maintainers,
>               1. In testing/selftests/vm/mlock2, the file opened at Line 39 may not closed when going to Line 65.
>               Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/tools/testing/selftests/vm/mlock2.h#L37-L49

That's what exit() does.  I don't think we really care unless the leak
is inside a loop.

That being said, it's untidy and is setting a poor example so I guess
we should fix it.

>               Can I send I a patch?

It would be better to just send the patch rather than preceding it
with "can I send a patch".  Everyone can send a patch and they are
encouraged to do so!


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

end of thread, other threads:[~2021-12-30  3:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30  3:17 [Resource Leak] Missing closing files in testing/selftests/vm/mlock2 Ryan Cai
2021-12-30  3:51 ` Andrew Morton

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).