ip2: return -EFAULT on copy_to_user errors
Subsystems (2)
PATCH 2/2 ip2: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bytes remaining but we want to return a negative error code on errors.
Signed-off-by Dan Carpenter <[email protected]>
drivers/char/ip2/ip2main.c +2 -0
@@ -2930,6 +2930,8 @@ ip2_ipl_ioctl (struct file *pFile, UINT cmd, ULONG arg )if ( pCh ) { rc =copy_to_user (argp, pCh,sizeof (i2ChanStr)); +if (rc) + rc = -EFAULT ; }else { rc = -ENODEV ; }