lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon,  1 Feb 2016 20:55:17 -0500
From:	Insu Yun <wuninsu@...il.com>
To:	akpm@...ux-foundation.org, viro@...iv.linux.org.uk, fabf@...net.be,
	osandov@...ndov.com, geert@...ux-m68k.org, tsgatesv@...il.com,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	taesoo@...ech.edu, yeongjin.jang@...ech.edu, insu@...ech.edu,
	changwoo@...ech.edu, Insu Yun <wuninsu@...il.com>
Subject: [PATCH] affs: add kunmap in error path

When error occurs, it needs to unmap page.

Signed-off-by: Insu Yun <wuninsu@...il.com>
---
 fs/affs/file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/affs/file.c b/fs/affs/file.c
index 0548c53..fa4f24e 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -520,8 +520,10 @@ affs_do_readpage_ofs(struct page *page, unsigned to)
 
 	while (pos < to) {
 		bh = affs_bread_ino(inode, bidx, 0);
-		if (IS_ERR(bh))
+		if (IS_ERR(bh)) {
+			kunmap(page);
 			return PTR_ERR(bh);
+		}
 		tmp = min(bsize - boff, to - pos);
 		BUG_ON(pos + tmp > to || tmp > bsize);
 		memcpy(data + pos, AFFS_DATA(bh) + boff, tmp);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ