From patchwork Wed Aug 8 09:02:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuanhan Liu X-Patchwork-Id: 1293401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id AEBF83FCFC for ; Wed, 8 Aug 2012 09:05:53 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sz2A7-0007xm-LK; Wed, 08 Aug 2012 09:02:43 +0000 Received: from mail-yx0-f195.google.com ([209.85.213.195]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sz2A4-0007x0-9o for linux-arm-kernel@lists.infradead.org; Wed, 08 Aug 2012 09:02:41 +0000 Received: by yenl7 with SMTP id l7so256896yen.6 for ; Wed, 08 Aug 2012 02:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=j81JDfpVpLncaF4XWxzWv3b0QVyW5LlP2Dqo8qePYqs=; b=neI6n8GivgBtMae4AQxUh1RmGBvs0tnMcg/MUPQItqLetcx6Lb+CL+R0Yz99v55Xdf FqUfCMdYUXrSjsedT0jtvIgmPTQAkvsmmgG+pcyrTHVGK2n1xoJtAtQ0XQ/aZQGo9p5c xSiBF/58g6ZXI53jMgCfM4N1yTZFmofAv1ZLr1bPtVEeIMo5YGqBAvZrN5oPh7Sb5rny D69/7DVdfzVhsyJYPC+s2LFM5TklQq7ZuRH1BmS+6kBBgtkf4wYeqfO0mkfjOm30Lw6i QUkIIS+299UcuPYFVufh9G/U4tRRbuhqRnD/lGZ/CqvL1Hcanf4KICxNJQrqAgI4gOzI 3zyA== Received: by 10.68.225.231 with SMTP id rn7mr34404081pbc.13.1344416558113; Wed, 08 Aug 2012 02:02:38 -0700 (PDT) Received: from localhost.localdomain ([110.53.94.132]) by mx.google.com with ESMTPS id pe2sm9581210pbc.59.2012.08.08.02.02.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Aug 2012 02:02:36 -0700 (PDT) From: Yuanhan Liu To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: mmp: fix potential NULL dereference Date: Wed, 8 Aug 2012 17:02:08 +0800 Message-Id: <1344416528-3586-1-git-send-email-yliu.null@gmail.com> X-Mailer: git-send-email 1.7.4.4 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.4 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (yliu.null[at]gmail.com) 1.3 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.195 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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 Cc: Eric Miao , Haojian Zhuang , Yuanhan Liu , Leo Yan X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fix the wrong logic: we should use || instead of && Cc: Leo Yan Cc: Haojian Zhuang Cc: Eric Miao Signed-off-by: Yuanhan Liu --- arch/arm/mach-mmp/sram.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-mmp/sram.c b/arch/arm/mach-mmp/sram.c index 4304f95..7e8a5a2 100644 --- a/arch/arm/mach-mmp/sram.c +++ b/arch/arm/mach-mmp/sram.c @@ -68,7 +68,7 @@ static int __devinit sram_probe(struct platform_device *pdev) struct resource *res; int ret = 0; - if (!pdata && !pdata->pool_name) + if (!pdata || !pdata->pool_name) return -ENODEV; info = kzalloc(sizeof(*info), GFP_KERNEL);