projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8bebc8
)
tools/power/x86/intel-speed-select: Handle open() failure case
author
Zhang Rui
<rui.zhang@intel.com>
Thu, 12 Jan 2023 06:43:35 +0000
(14:43 +0800)
committer
Hans de Goede
<hdegoede@redhat.com>
Fri, 3 Feb 2023 08:56:58 +0000
(09:56 +0100)
Add handling for open() failure case to make sure a valid file
descriptor is passed to dup().
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
tools/power/x86/intel-speed-select/isst-daemon.c
patch
|
blob
|
history
diff --git
a/tools/power/x86/intel-speed-select/isst-daemon.c
b/tools/power/x86/intel-speed-select/isst-daemon.c
index
0699137
..
4ad6a64
100644
(file)
--- a/
tools/power/x86/intel-speed-select/isst-daemon.c
+++ b/
tools/power/x86/intel-speed-select/isst-daemon.c
@@
-174,6
+174,8
@@
static void daemonize(char *rundir, char *pidfile)
close(i);
i = open("/dev/null", O_RDWR);
+ if (i < 0)
+ exit(EXIT_FAILURE);
ret = dup(i);
if (ret == -1)
exit(EXIT_FAILURE);