Re: [WATCHDOG] sa1100_wdt.c sparse cleanups

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

 



On Wed, Nov 02, 2005 at 08:56:49AM +0000, Ian Campbell wrote:
> @@ -96,20 +96,20 @@
>  
>  	switch (cmd) {
>  	case WDIOC_GETSUPPORT:
> -		ret = copy_to_user((struct watchdog_info *)arg, &ident,
> +		ret = copy_to_user((struct watchdog_info __user *)arg, &ident,
>  				   sizeof(ident)) ? -EFAULT : 0;

It's probably better to use a union with these, eg:

	union {
		void __user *arg;
		struct watchdog_info __user *info;
		int __user *i;
	} u;

	u.arg = (void __user *)arg;

...

	ret = copy_to_user(u.info, &ident, sizeof(ident)) ? -EFAULT : 0;

etc


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux