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:
John Baldwin 2006-02-23 18:05:38 +00:00
parent 784daffb89
commit 44a4a80962

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