[PATCH 439/641] Staging: sep: fix time handler
Greg Kroah-Hartman
gregkh at suse.de
Tue Sep 15 19:11:10 UTC 2009
From: Alan Cox <alan at linux.intel.com>
Cleaning up the code reveals an obvious thinko
Signed-off-by: Alan Cox <alan at linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---
drivers/staging/sep/sep_driver.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c
index fe46c1b..c2d9cab 100644
--- a/drivers/staging/sep/sep_driver.c
+++ b/drivers/staging/sep/sep_driver.c
@@ -2143,7 +2143,9 @@ static int sep_get_time_handler(unsigned long arg)
struct sep_driver_get_time_t command_args;
error = sep_set_time(&command_args.time_physical_address, &command_args.time_value);
- error = copy_to_user((void *) arg, (void *) &command_args, sizeof(struct sep_driver_get_time_t));
+ if (error == 0)
+ error = copy_to_user((void __user *)arg,
+ &command_args, sizeof(struct sep_driver_get_time_t));
return error;
}
--
1.6.4.2
More information about the devel
mailing list