mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-02 19:52:02 +00:00
btrfs-progs: Check periodic.timer_fd's value before use
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>
This commit is contained in:
parent
1b9876f761
commit
f3fbb9a398
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user