From 2ad023130998069fa2b9a6a59bc1aeb62f8ff27b Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Sun, 20 Mar 2016 19:06:21 +0000 Subject: [PATCH] Check bsd_to_linux_statfs() return value. Forgotten in r297070. MFC after: 1 week --- sys/compat/linux/linux_stats.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 7b4017eb626d..3638c6be1ca0 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -429,7 +429,9 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args) LFREEPATH(path); if (error) return (error); - bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + if (error) + return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } @@ -510,8 +512,10 @@ linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args) #endif error = kern_fstatfs(td, args->fd, &bsd_statfs); if (error) - return error; - bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + return (error); + error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + if (error) + return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); }