diff options
author | jhb <jhb@FreeBSD.org> | 2006-02-23 18:05:38 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-02-23 18:05:38 +0000 |
commit | 63b31d58a0dfe58bf663d66d60296685233b8274 (patch) | |
tree | 723ce7620a5a4695b41f1e4cecbd322ba7cde9c0 /sys | |
parent | 874c395bbd8ee8fb0008e16a3ae040ce4d1a9202 (diff) | |
download | FreeBSD-src-63b31d58a0dfe58bf663d66d60296685233b8274.zip FreeBSD-src-63b31d58a0dfe58bf663d66d60296685233b8274.tar.gz |
Check the return value of copyin() and return an error if it fails.
Coverity ID: 839
Found by: Coverity Prevent
MFC after: 1 week
Reviewed by: ps, scottl
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/amr/amr_linux.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/amr/amr_linux.c b/sys/dev/amr/amr_linux.c index 585e3e5..d454c34 100644 --- a/sys/dev/amr/amr_linux.c +++ b/sys/dev/amr/amr_linux.c @@ -170,13 +170,15 @@ amr_linux_ioctl(d_thread_t *p, struct linux_ioctl_args *args) devclass_t devclass; struct amr_softc *sc; struct amr_linux_ioctl ali; - int adapter; + int adapter, error; devclass = devclass_find("amr"); if (devclass == NULL) return (ENOENT); - copyin((caddr_t)args->arg, &ali, sizeof(ali)); + error = copyin((caddr_t)args->arg, &ali, sizeof(ali)); + if (error) + return (error); if (ali.ui.fcs.opcode == 0x82) adapter = 0; else |