mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/spdxcheck: fix file descriptor leak in read_spdxdata()
@ 2026-08-26 14:53 3237174131
  2026-08-26 15:30 ` Greg KH
  2026-08-26 16:42 ` Jonathan Corbet
  0 siblings, 2 replies; 4+ messages in thread
From: 3237174131 @ 2026-08-26 14:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, gregkh

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

Hi all,

This is my first kernel patch. Please let me know if anything is wrong.

Signed-off-by: Xia Zhoxin <3237174131@qq.com>

[-- Attachment #2: 0001-scripts-spdxcheck-fix-file-descriptor-leak.patch --]
[-- Type: application/octet-stream, Size: 925 bytes --]

From: Xia Zhoxin <3237174131@qq.com>
Subject: [PATCH] scripts/spdxcheck: fix file descriptor leak in read_spdxdata()
To: linux-kernel@vger.kernel.org
Cc: tglx@kernel.org, gregkh@linuxfoundation.org

Hi all,

This is my first kernel patch. Please let me know if anything is wrong.

Signed-off-by: Xia Zhoxin <3237174131@qq.com>
---
 scripts/spdxcheck.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -72,7 +72,8 @@ def read_spdxdata(repo):
             exception = None
-            for l in open(el.path, encoding="utf-8").readlines():
+            with open(el.path, encoding="utf-8") as f:
+                for l in f:
                     if l.startswith('Valid-License-Identifier:'):
                         lid = l.split(':')[1].strip().upper()
                         if lid in spdx.licenses:

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] scripts/spdxcheck: fix file descriptor leak in read_spdxdata()
@ 2026-08-25 13:46 夏 周鑫
  0 siblings, 0 replies; 4+ messages in thread
From: 夏 周鑫 @ 2026-08-25 13:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, gregkh

Hi all,

This is my first kernel patch. Please let me know if anything is wrong.

Signed-off-by: Xia Zhoxin <x15726828610@outlook.com>
---
 scripts/spdxcheck.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -72,7 +72,8 @@ def read_spdxdata(repo):
             exception = None
-            for l in open(el.path, encoding="utf-8").readlines():
+            with open(el.path, encoding="utf-8") as f:
+                for l in f:
                     if l.startswith('Valid-License-Identifier:'):
                         lid = l.split(':')[1].strip().upper()
                         if lid in spdx.licenses:


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

end of thread, other threads:[~2026-08-26 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-26 14:53 [PATCH] scripts/spdxcheck: fix file descriptor leak in read_spdxdata() 3237174131
2026-08-26 15:30 ` Greg KH
2026-08-26 16:42 ` Jonathan Corbet
  -- strict thread matches above, loose matches on Subject: below --
2026-08-25 13:46 夏 周鑫

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®