From 3a81dbb2504c2c54e5fdb757a56ca4f98b45d7c7 Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Fri, 1 Apr 2011 13:50:10 +0200 Subject: [PATCH] gpu: pvr: fix pdumpfs_stream_buffer_clear Fix tmp[] filling loop so that size == sizeof(tmp) also functions correctly. Spotted-by: Phil Carmody Signed-off-by: Luc Verhaegen Signed-off-by: Imre Deak --- pvr/pvr_pdumpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvr/pvr_pdumpfs.c b/pvr/pvr_pdumpfs.c index 6050fd3..c1b7df5 100644 --- a/pvr/pvr_pdumpfs.c +++ b/pvr/pvr_pdumpfs.c @@ -786,7 +786,7 @@ pdumpfs_stream_buffer_clear(char __user *buf, size_t size) if (size >= sizeof(tmp)) { int i; - for (i = 0; (i + sizeof(tmp)) < size; i += sizeof(tmp)) + for (i = 0; (i + sizeof(tmp)) <= size; i += sizeof(tmp)) if (copy_to_user(buf + i, tmp, sizeof(tmp))) return -EFAULT; return i; -- 2.39.5