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
This commit is contained in:
jhb 2006-02-23 18:05:38 +00:00
parent 874c395bbd
commit 63b31d58a0

View File

@ -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