All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/clk/renesas/clk-r8a73a4.c:208 r8a73a4_cpg_clocks_init() warn: possible memory leak of 'cpg'
@ 2020-09-12 18:40 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-09-12 18:40 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Stephen Boyd <sboyd@kernel.org>
CC: Mark Brown <broonie@kernel.org>
CC: Arnd Bergmann <arnd@arndb.de>

Hi Stephen,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   729e3d091984487f7aa1ebfabfe594e5b317ed0f
commit: bbd7ffdbef6888459f301c5889f3b14ada38b913 clk: Allow the common clk framework to be selectable
date:   4 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 4 months ago
config: parisc-randconfig-m031-20200913 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/clk/renesas/clk-r8a73a4.c:208 r8a73a4_cpg_clocks_init() warn: possible memory leak of 'cpg'
drivers/gpu/drm/v3d/v3d_drv.h:296 nsecs_to_jiffies_timeout() warn: should this be a bitwise op?

Old smatch warnings:
drivers/gpu/drm/v3d/v3d_gem.c:573 v3d_submit_cl_ioctl() error: double free of 'bin'

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbd7ffdbef6888459f301c5889f3b14ada38b913
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout bbd7ffdbef6888459f301c5889f3b14ada38b913
vim +/cpg +208 drivers/clk/renesas/clk-r8a73a4.c

596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  188  
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  189  static void __init r8a73a4_cpg_clocks_init(struct device_node *np)
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  190  {
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  191  	struct r8a73a4_cpg *cpg;
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  192  	struct clk **clks;
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  193  	unsigned int i;
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  194  	int num_clks;
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  195  
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  196  	num_clks = of_property_count_strings(np, "clock-output-names");
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  197  	if (num_clks < 0) {
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  198  		pr_err("%s: failed to count clocks\n", __func__);
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  199  		return;
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  200  	}
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  201  
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  202  	cpg = kzalloc(sizeof(*cpg), GFP_KERNEL);
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  203  	clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL);
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  204  	if (cpg == NULL || clks == NULL) {
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  205  		/* We're leaking memory on purpose, there's no point in cleaning
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  206  		 * up as the system won't boot anyway.
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17  207  		 */
596bdcf7782899 drivers/clk/shmobile/clk-r8a73a4.c Ulrich Hecht 2014-12-17 @208  		return;

:::::: The code@line 208 was first introduced by commit
:::::: 596bdcf7782899d699c13aad7b20f1d99810d1fa clk: shmobile: r8a73a4 common clock framework implementation

:::::: TO: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
:::::: CC: Geert Uytterhoeven <geert+renesas@glider.be>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27428 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-12 18:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-12 18:40 drivers/clk/renesas/clk-r8a73a4.c:208 r8a73a4_cpg_clocks_init() warn: possible memory leak of 'cpg' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.