Re: watchdog: ts72xx_wdt: cleanup return codes in ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 23, 2013 at 05:38:32PM -0000, Dan Carpenter wrote:
> There seems to be some confusion here which functions return positive
> numbers and which return negative error codes.
> 
> copy_to_user() returns the number of bytes remaining to be copied but we
> want to return -EFAULT.
> 
> The rest is just clean up.  get_user() actually returns zero on success
> and -EFAULT on error so we can preserve the error code.  The
> timeout_to_regval() function returns -EINVAL on failure, but we can
> propogate that back instead of hardcoding -EINVAL ourselves.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux