From patchwork Tue Feb 2 01:55:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Insu Yun X-Patchwork-Id: 8185481 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 837169FB33 for ; Tue, 2 Feb 2016 01:55:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C55F020155 for ; Tue, 2 Feb 2016 01:55:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3F6A2022D for ; Tue, 2 Feb 2016 01:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbcBBBzT (ORCPT ); Mon, 1 Feb 2016 20:55:19 -0500 Received: from mail-yk0-f174.google.com ([209.85.160.174]:35378 "EHLO mail-yk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112AbcBBBzR (ORCPT ); Mon, 1 Feb 2016 20:55:17 -0500 Received: by mail-yk0-f174.google.com with SMTP id r207so124261440ykd.2; Mon, 01 Feb 2016 17:55:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Z+T8vXFL2XoIjeIWr4jjP2gHcK37oFhmUKcjfV5/Zu8=; b=eCEjAdIHR7iYv3dYixAKsq6NY4JT4q4JuoLKL+Qso9K8MFLExspYhhem5f+b6x5mol F9FMWAwFbf3rp7q3aPnES1+Px9+c9NieFtjH8XBD2rP5FCAXpl7TVyafgKq2cA4L4jNA 6XgohDlZrv2QrIMOXM0Z9xllQeg+6FmVMjRR7b0U8YmXL+DZOp6RzhwQ5mA1uqCDwlCs Q2WQfYEMdkWP2Kx3Ycrj/RcSxVsLQS+1ENtBI1EdMx3NjvhKx7g5P7wpzGV2ruyA5nJS UYt0gqkEkcX41RP62aHGcImqktOvbd9NPKvyQTmXHtCvQ0qwp7yH0eecThY/TJMW0wQk FUGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Z+T8vXFL2XoIjeIWr4jjP2gHcK37oFhmUKcjfV5/Zu8=; b=WfxQWprqoU7/2TXSt0cGqxySFlfa/MstCwxdGHYvhaw4oJUv/J8SoXxu8y4dHSjiix 3lTgdLYvG/UtS06w3fUeEDxL8ZgAJ4jTZfZwEBv9lauowiDVtYAgolYFTytWZROeyxNJ Guw52/yRaGcnJIEM715rrnWhjDtLKM0mJF9zfh554bgW2RGE5v4/qcuduily3WE+xsmL 1oXVEB3/p0AH5rYuS1mGv/fW6U4PMicn4I0NJjLFGEfLYRfQV5Q5yX5X3HtkVrSvZWJn GqLrE995ayk9IFxApDzawJVJVFx3Usd1xBiBCz8YZzKp6H323xgLto8dMEmQtYv9XXmz 2zrQ== X-Gm-Message-State: AG10YOQa/5bC0Z7JNpMMO8DtbWcgN0H8IWe+oNe8TT4zrwAolHIqlmJQF2yKNfw0J9c90w== X-Received: by 10.37.59.206 with SMTP id i197mr5318400yba.27.1454378116953; Mon, 01 Feb 2016 17:55:16 -0800 (PST) Received: from insu.gtisc.gatech.edu (insu.gtisc.gatech.edu. [143.215.130.94]) by smtp.gmail.com with ESMTPSA id x64sm23624242ywe.31.2016.02.01.17.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 17:55:16 -0800 (PST) From: Insu Yun To: akpm@linux-foundation.org, viro@zeniv.linux.org.uk, fabf@skynet.be, osandov@osandov.com, geert@linux-m68k.org, tsgatesv@gmail.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: taesoo@gatech.edu, yeongjin.jang@gatech.edu, insu@gatech.edu, changwoo@gatech.edu, Insu Yun Subject: [PATCH] affs: add kunmap in error path Date: Mon, 1 Feb 2016 20:55:17 -0500 Message-Id: <1454378117-14999-1-git-send-email-wuninsu@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When error occurs, it needs to unmap page. Signed-off-by: Insu Yun --- 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);