posix-timers: don't call ferror for NULL

parse_posix_timers should not call ferror if fopen returned NULL.

Reported-by: Adrian Reber <adrian@lisas.de>
Cc: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2013-07-02 20:25:14 +04:00 committed by Pavel Emelyanov
parent c8f3e09f17
commit f70859e2fc

View file

@ -1190,8 +1190,7 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args)
file = fopen_proc(pid, "timers");
if (file == NULL) {
pr_perror("Can't open posix timers file!");
ret = -1;
goto end_posix;
return -1;
}
while (1) {