The patch titled /dev/mem: cleanup unxlate_dev_mem_ptr() calls has been removed from the -mm tree. Its filename was dev-mem-cleanup-unxlate_dev_mem_ptr-calls.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: /dev/mem: cleanup unxlate_dev_mem_ptr() calls From: Wu Fengguang <fengguang.wu@xxxxxxxxx> No behaviour change. [akpm@xxxxxxxxxxxxxxxxxxxx: cleanuplets] [akpm@xxxxxxxxxxxxxxxxxxxx: remove unused `ret'] Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx> Acked-by: Andi Kleen <ak@xxxxxxxxxxxxxxx> Cc: Marcelo Tosatti <mtosatti@xxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx> Cc: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> Cc: Avi Kivity <avi@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/char/mem.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff -puN drivers/char/mem.c~dev-mem-cleanup-unxlate_dev_mem_ptr-calls drivers/char/mem.c --- a/drivers/char/mem.c~dev-mem-cleanup-unxlate_dev_mem_ptr-calls +++ a/drivers/char/mem.c @@ -154,6 +154,8 @@ static ssize_t read_mem(struct file * fi #endif while (count > 0) { + unsigned long remaining; + sz = size_inside_page(p, count); if (!range_is_allowed(p >> PAGE_SHIFT, count)) @@ -168,12 +170,10 @@ static ssize_t read_mem(struct file * fi if (!ptr) return -EFAULT; - if (copy_to_user(buf, ptr, sz)) { - unxlate_dev_mem_ptr(p, ptr); - return -EFAULT; - } - + remaining = copy_to_user(buf, ptr, sz); unxlate_dev_mem_ptr(p, ptr); + if (remaining) + return -EFAULT; buf += sz; p += sz; @@ -231,16 +231,14 @@ static ssize_t write_mem(struct file * f } copied = copy_from_user(ptr, buf, sz); + unxlate_dev_mem_ptr(p, ptr); if (copied) { written += sz - copied; - unxlate_dev_mem_ptr(p, ptr); if (written) break; return -EFAULT; } - unxlate_dev_mem_ptr(p, ptr); - buf += sz; p += sz; count -= sz; _ Patches currently in -mm which might be from fengguang.wu@xxxxxxxxx are origin.patch linux-next.patch readahead-add-blk_run_backing_dev.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html