aio: fix possible invalid memory access when DEBUG is enabled
authorZhao Hongjiang <zhaohongjiang@huawei.com>
Fri, 26 Apr 2013 03:03:53 +0000 (11:03 +0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Apr 2013 14:56:18 +0000 (07:56 -0700)
dprintk() shouldn't access @ring after it's unmapped.

Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/aio.c

index 3f941f2a305949f31ba9dce2a4e87f6849e8ab71..1dc8786f4588355245a90063e02464ff35e07760 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1029,9 +1029,9 @@ static int aio_read_evt(struct kioctx *ioctx, struct io_event *ent)
        spin_unlock(&info->ring_lock);
 
 out:
-       kunmap_atomic(ring);
        dprintk("leaving aio_read_evt: %d  h%lu t%lu\n", ret,
                 (unsigned long)ring->head, (unsigned long)ring->tail);
+       kunmap_atomic(ring);
        return ret;
 }