lkml.org 
[lkml]   [2012]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] ufs: fix return value check in ufs_alloc_lastblock()
From
From: Wei Yongjun <yongjun_wei@trendmicro.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@trendmicro.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;
}


\
 
 \ /
  Last update: 2012-09-21 08:21    [W:0.033 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site