From patchwork Sun Mar 20 11:12:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 646671 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2KBD7Q2006220 for ; Sun, 20 Mar 2011 11:13:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751820Ab1CTLNG (ORCPT ); Sun, 20 Mar 2011 07:13:06 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:38990 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910Ab1CTLNF (ORCPT ); Sun, 20 Mar 2011 07:13:05 -0400 Received: by bwz15 with SMTP id 15so4399452bwz.19 for ; Sun, 20 Mar 2011 04:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=A+9v6rD8tyr6Ltb6z+91dLD2sWhq5V3S8ymwgh4wrjM=; b=pepcIkBFQIXaxRX8ATn3fBeQ9Mw99Y4/vb9/u1oaA3vpjGtVs2FtROD+vpPWwDE2mn /yYCMWLfS2/+g/MQ12jKi2YxI83tljTpUAbOpVKK1WCpyme5BTIzDhls7RP3807KFejo iVhB1M/u6kWwH3gRoHG1xsHV7OKZA3EmhNmHs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=PxXPXyPI6g1FpDclN5mUrzyCQQq26LaoHx7GV7VAsc4tQbahmZRhYa8eiWrCcsocxT Q5tCw3yE8nl1KWHlvK7xIhdHC8PZ1NVC2VuCXkrup/VY+b4MPS2ee1jb74jBfAhXP7B9 9X1O5Lgv0xeV4khpi9XkO1gTe/3Or2LB8sPbI= Received: by 10.204.20.65 with SMTP id e1mr2663756bkb.149.1300619584090; Sun, 20 Mar 2011 04:13:04 -0700 (PDT) Received: from bicker ([212.49.88.34]) by mx.google.com with ESMTPS id j13sm839976faa.3.2011.03.20.04.12.59 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 20 Mar 2011 04:13:03 -0700 (PDT) Date: Sun, 20 Mar 2011 14:12:49 +0300 From: Dan Carpenter To: Paul Mundt Cc: Magnus Damm , Guennadi Liakhovetski , linux-sh@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] sh: clkfwk: potential null deref in debug code Message-ID: <20110320111249.GH2008@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 20 Mar 2011 11:13:07 +0000 (UTC) diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c index 5f63c3b..dee971c 100644 --- a/drivers/sh/clk/core.c +++ b/drivers/sh/clk/core.c @@ -616,7 +616,7 @@ long clk_round_parent(struct clk *clk, unsigned long target, pr_debug("%u / %lu = %lu, / %lu = %lu, best %lu, parent %u\n", freq->frequency, div, freq_high, div + 1, freq_low, - *best_freq, best->frequency); + best_freq ? *best_freq : -1, best->frequency); if (!error) break;