Re: [PATCH] watchdog: fix GETTIMEOUT ioctl in booke_wdt

From: Timur Tabi
Date: Fri Jan 27 2012 - 16:08:18 EST


Dmitry Artamonow wrote:
> +#ifdef CONFIG_FSL_BOOKE
> + return put_user(period_to_sec(booke_wdt_period), p);
> +#else

period_to_sec() returns an unsigned long long, which means that the driver
will write 8 bytes instead of 4 to user space. You need to use a
temporary u32, just like WDIOC_SETTIMEOUT:

if (get_user(tmp, p))
return -EFAULT;


--
Timur Tabi
Linux kernel developer at Freescale

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/