projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b9876f
)
btrfs-progs: Check periodic.timer_fd's value before use
author
Zhao Lei
<zhaolei@cn.fujitsu.com>
Mon, 9 Nov 2015 09:06:53 +0000
(17:06 +0800)
committer
David Sterba
<dsterba@suse.com>
Mon, 16 Nov 2015 13:23:45 +0000
(14:23 +0100)
periodic.timer_fd's value is 0 on inititlize-failed case,
if no value-checking before read(), the code will run as
read(STDIN).
This patch fixed above case.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
task-utils.c
patch
|
blob
|
history
diff --git
a/task-utils.c
b/task-utils.c
index
a4017ff
..
12b0002
100644
(file)
--- a/
task-utils.c
+++ b/
task-utils.c
@@
-119,6
+119,9
@@
void task_period_wait(struct task_info *info)
if (!info)
return;
+ if (info->periodic.timer_fd == 0)
+ return;
+
ret = read(info->periodic.timer_fd, &missed, sizeof (missed));
if (ret == -1)
return;