mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: zhujun2 <zhujun2@cmss.chinamobile.com>, shuah@kernel.org
Cc: ivan.orlov0322@gmail.com, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/media_tests: fix a resource leak
Date: Wed, 15 Nov 2023 10:34:16 -0500	[thread overview]
Message-ID: <8431b227-d053-4a9a-a278-2a43753fdaf7@efficios.com> (raw)
In-Reply-To: <20231114093812.7169-1-zhujun2@cmss.chinamobile.com>

On 2023-11-14 04:38, zhujun2 wrote:
> The opened file should be closed in main(), otherwise resource
> leak will occur that this problem was discovered by code reading

Fixing resource leaks for one-off test cases (processes execute and
then immediately exit) seems to be something that would fit in the
definition of "trivial", so I would advise to perhaps send those
patches to kernel-janitors@vger.kernel.org ?

[...]

> +
> +	close(fd);

These added calls to close(2) miss handling of possible close errors
(check return value and use errno to print an error).

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com


  reply	other threads:[~2023-11-15 15:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14  9:38 zhujun2
2023-11-15 15:34 ` Mathieu Desnoyers [this message]
2023-11-21  2:59   ` zhujun2
2023-11-21  7:47     ` Dan Carpenter
2023-11-21  9:32       ` [PATCH v1] " Zhu Jun
2023-11-21  9:42         ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8431b227-d053-4a9a-a278-2a43753fdaf7@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=ivan.orlov0322@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=zhujun2@cmss.chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®