From patchwork Sun Sep 5 18:33:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kulikov Vasiliy X-Patchwork-Id: 63853 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D8D5CB70D3 for ; Mon, 6 Sep 2010 04:34:44 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OsK1i-0000oT-M5; Sun, 05 Sep 2010 18:33:14 +0000 Received: from mail-ey0-f177.google.com ([209.85.215.177]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OsK1g-0000nt-Cy for linux-mtd@lists.infradead.org; Sun, 05 Sep 2010 18:33:13 +0000 Received: by eye22 with SMTP id 22so2056198eye.36 for ; Sun, 05 Sep 2010 11:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=CV+/YeeYbTqGRBVJgMEJPSsoxWuefpIWDB/cKzpGWeY=; b=gwxPnKRbXgt1OcMr9wnLAcdkBJWwIsjWIC0r8k93ClJLSeLYRp8KtJVOWps3xo04t6 XyRCE5AMv0kc0aZiAKeLQ6mLUj1tpFtycN936k+QWnO4zfhe6pPGVAIve+wdwG/5pWC4 U7m3h4w7wVV1pSJ7TToUmOl+VEKj8VXKKNaZg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=qa/gcQ1i8VP1AW0eVPWpSDP8/7pN1Xkyb0B373CVeFQneNvSykNwy3kY8S1UbhtGoz Fy8HCHmgsqa0Is8+2AvOYCNZJuEHcavI2q7Ux469mi7N4D65+/U7Nl2uEb1yivSwyaDH 4mGspfzRJEypzlqf6+Y6cV9BxvVdZveCXlpvA= Received: by 10.213.27.201 with SMTP id j9mr61278ebc.33.1283711590251; Sun, 05 Sep 2010 11:33:10 -0700 (PDT) Received: from localhost (ppp85-140-162-44.pppoe.mtu-net.ru [85.140.162.44]) by mx.google.com with ESMTPS id a48sm6693339eei.12.2010.09.05.11.33.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 05 Sep 2010 11:33:09 -0700 (PDT) From: Kulikov Vasiliy To: kernel-janitors@vger.kernel.org Subject: [PATCH 12/14] ubifs: check return code of pnode_lookup Date: Sun, 5 Sep 2010 22:33:04 +0400 Message-Id: <1283711584-7587-1-git-send-email-segooon@gmail.com> X-Mailer: git-send-email 1.7.0.4 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100905_143312_796031_072686AC X-CRM114-Status: GOOD ( 13.21 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is freemail (segooon[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: Artem Bityutskiy , Vasiliy Kulikov , linux-kernel@vger.kernel.org, Julia Lawall , Tejun Heo , linux-mtd@lists.infradead.org, Adrian Hunter X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Vasiliy Kulikov Function pnode_lookup may return ERR_PTR(...). Check for it. Signed-off-by: Vasiliy Kulikov --- Compile tested. fs/ubifs/lpt_commit.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index d12535b..5c90dec 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c @@ -705,6 +705,9 @@ static int make_tree_dirty(struct ubifs_info *c) struct ubifs_pnode *pnode; pnode = pnode_lookup(c, 0); + if (IS_ERR(pnode)) + return PTR_ERR(pnode); + while (pnode) { do_make_pnode_dirty(c, pnode); pnode = next_pnode_to_dirty(c, pnode);