mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Abel Vesa <abel.vesa@nxp.com>, Stephen Boyd <sboyd@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>, Peng Fan <peng.fan@nxp.com>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Anson Huang <anson.huang@nxp.com>,
	Dong Aisheng <aisheng.dong@nxp.com>, Jacky Bai <ping.bai@nxp.com>
Cc: NXP Linux Team <linux-imx@nxp.com>,
	kbuild-all@lists.01.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/5] clk: Add CLK_GET_PARENT_NOCACHE flag (fwd)
Date: Fri, 27 Nov 2020 14:29:58 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2011271427440.2703@hadrien> (raw)

[-- Attachment #1: Type: text/plain, Size: 4040 bytes --]

Please check line 2432.  Based on the preceeding tests, there may be a
NULL pointer dereference.

julia

---------- Forwarded message ----------
Date: Fri, 27 Nov 2020 06:27:51 +0800
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Cc: lkp@intel.com, Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH v2 2/5] clk: Add CLK_GET_PARENT_NOCACHE flag

CC: kbuild-all@lists.01.org
In-Reply-To: <1606394409-12755-3-git-send-email-abel.vesa@nxp.com>
References: <1606394409-12755-3-git-send-email-abel.vesa@nxp.com>
TO: Abel Vesa <abel.vesa@nxp.com>
TO: Stephen Boyd <sboyd@kernel.org>
TO: Sascha Hauer <kernel@pengutronix.de>
TO: Peng Fan <peng.fan@nxp.com>
TO: Fabio Estevam <fabio.estevam@nxp.com>
TO: Anson Huang <anson.huang@nxp.com>
TO: Dong Aisheng <aisheng.dong@nxp.com>
TO: Jacky Bai <ping.bai@nxp.com>
CC: NXP Linux Team <linux-imx@nxp.com>
CC: linux-clk@vger.kernel.org
CC: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>

Hi Abel,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on shawnguo/for-next]
[also build test WARNING on clk/clk-next v5.10-rc5 next-20201126]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Abel-Vesa/clk-imx-Register-the-dram_apb-and-dram_alt-as-read-only/20201126-204442
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git for-next
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: x86_64-randconfig-c002-20201127 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/clk/clk.c:2432:23-29: ERROR: clk -> core is NULL but dereferenced.
   drivers/clk/clk.c:2432:50-56: ERROR: clk -> core is NULL but dereferenced.

vim +2432 drivers/clk/clk.c

05e4e881cde17e7 Abel Vesa    2020-11-26  2413
4dff95dc9477a34 Stephen Boyd 2015-04-30  2414  /**
4dff95dc9477a34 Stephen Boyd 2015-04-30  2415   * clk_get_parent - return the parent of a clk
4dff95dc9477a34 Stephen Boyd 2015-04-30  2416   * @clk: the clk whose parent gets returned
4dff95dc9477a34 Stephen Boyd 2015-04-30  2417   *
4dff95dc9477a34 Stephen Boyd 2015-04-30  2418   * Simply returns clk->parent.  Returns NULL if clk is NULL.
4935b22c46ea5e2 James Hogan  2013-07-29  2419   */
4dff95dc9477a34 Stephen Boyd 2015-04-30  2420  struct clk *clk_get_parent(struct clk *clk)
4dff95dc9477a34 Stephen Boyd 2015-04-30  2421  {
4dff95dc9477a34 Stephen Boyd 2015-04-30  2422  	struct clk *parent;
da0f0b2c3ad2ad9 Tomasz Figa  2013-09-29  2423
fc4a05d4b0eb1a0 Stephen Boyd 2015-06-25  2424  	if (!clk)
fc4a05d4b0eb1a0 Stephen Boyd 2015-06-25  2425  		return NULL;
fc4a05d4b0eb1a0 Stephen Boyd 2015-06-25  2426
4dff95dc9477a34 Stephen Boyd 2015-04-30  2427  	clk_prepare_lock();
05e4e881cde17e7 Abel Vesa    2020-11-26  2428  	if (clk->core && (clk->core->flags & CLK_GET_PARENT_NOCACHE))
05e4e881cde17e7 Abel Vesa    2020-11-26  2429  		parent = __clk_get_parent(clk->core)->hw->clk;
05e4e881cde17e7 Abel Vesa    2020-11-26  2430  	else
fc4a05d4b0eb1a0 Stephen Boyd 2015-06-25  2431  		/* TODO: Create a per-user clk and change callers to call clk_put */
fc4a05d4b0eb1a0 Stephen Boyd 2015-06-25 @2432  		parent = !clk->core->parent ? NULL : clk->core->parent->hw->clk;
4dff95dc9477a34 Stephen Boyd 2015-04-30  2433  	clk_prepare_unlock();
4935b22c46ea5e2 James Hogan  2013-07-29  2434
4dff95dc9477a34 Stephen Boyd 2015-04-30  2435  	return parent;
4935b22c46ea5e2 James Hogan  2013-07-29  2436  }
4dff95dc9477a34 Stephen Boyd 2015-04-30  2437  EXPORT_SYMBOL_GPL(clk_get_parent);
4935b22c46ea5e2 James Hogan  2013-07-29  2438

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: Type: application/gzip, Size: 26589 bytes --]

                 reply	other threads:[~2020-11-27 13:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2011271427440.2703@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=abel.vesa@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=fabio.estevam@nxp.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®