[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd-Fpei5pNeyLrgvQogEF8phJrr2F-nKpchG6JE9ykxiWg@mail.gmail.com>
Date: Fri, 21 Sep 2012 13:51:18 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: dushistov@...l.ru
Cc: yongjun_wei@...ndmicro.com.cn, linux-kernel@...r.kernel.org
Subject: [PATCH] ufs: fix return value check in ufs_alloc_lastblock()
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
In case of error, the function ufs_get_locked_page() returns ERR_PTR()
or NULL pointer. The IS_ERR() test in the error handling should be
replaced with IS_ERR_OR_NULL().
dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
fs/ufs/truncate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index f04f89f..82426ed 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -391,7 +391,7 @@ static int ufs_alloc_lastblock(struct inode *inode)
lastpage = ufs_get_locked_page(mapping, lastfrag >>
(PAGE_CACHE_SHIFT - inode->i_blkbits));
- if (IS_ERR(lastpage)) {
+ if (IS_ERR_OR_NULL(lastpage)) {
err = -EIO;
goto out;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists