lshw/0001-fix-not-closing-fd-during-framebuffer-detection.patch
Tao Liu 9595daec84 Release B.02.20-8
Update lshw to upstream latest(af7c69e1b6e)

Resolves: RHEL-114949

Signed-off-by: Tao Liu <ltao@redhat.com>
2025-10-22 10:44:50 +13:00

36 lines
806 B
Diff

From c17d8837aa2387207c353529c0910d9cfbc81bb1 Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Mon, 28 Jul 2025 22:27:57 +0200
Subject: [PATCH 1/3] fix not closing fd during framebuffer detection
patch from Rafi Wiener (github PR#106)
---
src/core/fb.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/core/fb.cc b/src/core/fb.cc
index d198982..465c899 100644
--- a/src/core/fb.cc
+++ b/src/core/fb.cc
@@ -233,6 +233,7 @@ bool scan_fb(hwNode & n)
if (fd[i] >= 0)
{
+ fbdevs++;
hwNode *fbdev = NULL;
struct fb_fix_screeninfo fbi;
@@ -335,7 +336,8 @@ bool scan_fb(hwNode & n)
for (unsigned int j = 0; j < fbdevs; j++)
{
- close(fd[j]);
+ if (fd[j] >= 0)
+ close(fd[j]);
}
return false;
--
2.47.0