From: Jes Sorensen Date: Mon, 22 Oct 2007 00:56:22 +0000 (+1000) Subject: Use copy_to_user() not put_user for struct timespec X-Git-Tag: upstream/snapshot3+hdmi~29332^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=891ff65ff50bb6affdaebb2cda3a4c58a6442b4d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Use copy_to_user() not put_user for struct timespec Use copy_to_user() when copying a struct timespec to the guest - put_user() cannot handle two long's in one go on a 64bit arch. Signed-off-by: Jes Sorensen Signed-off-by: Rusty Russell Cc: Jes Sorensen Cc: Al Viro --- diff --git a/drivers/lguest/hypercalls.c b/drivers/lguest/hypercalls.c index db6caac..5ecd60b 100644 --- a/drivers/lguest/hypercalls.c +++ b/drivers/lguest/hypercalls.c @@ -295,6 +295,6 @@ void write_timestamp(struct lguest *lg) { struct timespec now; ktime_get_real_ts(&now); - if (put_user(now, &lg->lguest_data->time)) + if (copy_to_user(&lg->lguest_data->time, &now, sizeof(struct timespec))) kill_guest(lg, "Writing timestamp"); }