Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602AbbLADme (ORCPT ); Mon, 30 Nov 2015 22:42:34 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:60391 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637AbbLADmd (ORCPT ); Mon, 30 Nov 2015 22:42:33 -0500 X-AuditID: cbfee61b-f793c6d00000236c-d0-565d1727b920 From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] f2fs: clean up error path in f2fs_readdir Date: Tue, 01 Dec 2015 11:41:50 +0800 Message-id: <000101d12bea$4ea0d5c0$ebe28140$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdEr6iqUs3B8ccfTSOOUZRz3XbcYNw== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsVy+t9jQV118dgwg72bRS2erJ/FbHFpkbvF 5V1z2ByYPTat6mTz2L3gM5PH501yAcxRXDYpqTmZZalF+nYJXBnzHm1gKfjKXvGwdRpzA+N6 ti5GTg4JAROJj9PaoWwxiQv3QOJcHEICsxglli66yQLhvGKUuHDwDgtIFZuAisTyjv9MILYI kH1o0WV2EJtZwEOiseM7K4gtLGAn0bftKZjNIqAqsbjjBNgGXgFLie3/7zNC2IISPybfY4Ho 1ZJYv/M4E4QtL7F5zVtmiIsUJHacfc0IsUtPom/td0aIGnGJjUdusUxgBDoTYdQsJKNmIRk1 C0nLAkaWVYwSqQXJBcVJ6blGeanlesWJucWleel6yfm5mxjBYfxMegfj4V3uhxgFOBiVeHgP rIoJE2JNLCuuzD3EKMHBrCTCu/o3UIg3JbGyKrUoP76oNCe1+BCjNAeLkjjvvkuRYUIC6Ykl qdmpqQWpRTBZJg5OqQbG2Rn/pT5PLz1hfjpmw990vmZ517l1D4TP1rG8TNrJrTiDyy3N7kSo pe7X9o1fBayNZvDkrvz3l//CvH3ZAsm3rjdVKPjYLmDZG+Fb/fqUVthqp+wQ0dVOPzqLJqmw zPvF+XOFxMrLb+uapj36HMMtf+f+1A8ue4MLulbN+/wh1Tn8xZWV+Y+OKLEUZyQaajEXFScC ACg22UZfAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1219 Lines: 44 No logic changes, just clean up the error path. Signed-off-by: Chao Yu --- fs/f2fs/dir.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 9de898d..6554fd5 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -867,18 +867,15 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx) make_dentry_ptr(inode, &d, (void *)dentry_blk, 1); - if (f2fs_fill_dentries(ctx, &d, n * NR_DENTRY_IN_BLOCK, &fstr)) - goto stop; + if (f2fs_fill_dentries(ctx, &d, n * NR_DENTRY_IN_BLOCK, &fstr)) { + kunmap(dentry_page); + f2fs_put_page(dentry_page, 1); + break; + } ctx->pos = (n + 1) * NR_DENTRY_IN_BLOCK; kunmap(dentry_page); f2fs_put_page(dentry_page, 1); - dentry_page = NULL; - } -stop: - if (dentry_page && !IS_ERR(dentry_page)) { - kunmap(dentry_page); - f2fs_put_page(dentry_page, 1); } out: f2fs_fname_crypto_free_buffer(&fstr); -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/