mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
geom: Report copyout() errors in g_ctl_ioctl_ctl()
Despite the name, req->serror is used in some cases to copy non-error messages to userspace. So, report errors when copying out so long as they don't clobber an earlier error. Reviewed by: mav, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43146
This commit is contained in:
parent
6cdff09c0d
commit
bbf221e3e8
@ -616,8 +616,10 @@ g_ctl_ioctl_ctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct th
|
||||
}
|
||||
}
|
||||
if (sbuf_done(req->serror)) {
|
||||
copyout(sbuf_data(req->serror), req->error,
|
||||
nerror = copyout(sbuf_data(req->serror), req->error,
|
||||
imin(req->lerror, sbuf_len(req->serror) + 1));
|
||||
if (nerror != 0 && req->nerror == 0)
|
||||
req->nerror = nerror;
|
||||
}
|
||||
|
||||
nerror = req->nerror;
|
||||
|
Loading…
Reference in New Issue
Block a user