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:
parent
784daffb89
commit
44a4a80962
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user