linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bernard Zhao <bernard@vivo.com>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Edmund Dea <edmund.j.dea@intel.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, Bernard Zhao <bernard@vivo.com>
Subject: Re: [PATCH] drm/kmb: fix potential memleak in error branch
Date: Sun, 21 Nov 2021 00:08:52 +0800	[thread overview]
Message-ID: <202111210049.SogNkVBR-lkp@intel.com> (raw)
In-Reply-To: <20211118023723.85553-1-bernard@vivo.com>

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

Hi Bernard,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm/drm-next]
[also build test ERROR on v5.16-rc1 next-20211118]
[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/Bernard-Zhao/drm-kmb-fix-potential-memleak-in-error-branch/20211118-103810
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/bbd8ae6a806e8e9e31c362a76ab4ba02a43b4694
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Bernard-Zhao/drm-kmb-fix-potential-memleak-in-error-branch/20211118-103810
        git checkout bbd8ae6a806e8e9e31c362a76ab4ba02a43b4694
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

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

All errors (new ones prefixed by >>):

   drivers/gpu/drm/kmb/kmb_drv.c: In function 'kmb_probe':
>> drivers/gpu/drm/kmb/kmb_drv.c:517:17: error: implicit declaration of function 'of_dev_put'; did you mean 'drm_dev_put'? [-Werror=implicit-function-declaration]
     517 |                 of_dev_put(dsi_pdev);
         |                 ^~~~~~~~~~
         |                 drm_dev_put
   cc1: some warnings being treated as errors


vim +517 drivers/gpu/drm/kmb/kmb_drv.c

   475	
   476	static int kmb_probe(struct platform_device *pdev)
   477	{
   478		struct device *dev = get_device(&pdev->dev);
   479		struct kmb_drm_private *kmb;
   480		int ret = 0;
   481		struct device_node *dsi_in;
   482		struct device_node *dsi_node;
   483		struct platform_device *dsi_pdev;
   484	
   485		/* The bridge (ADV 7535) will return -EPROBE_DEFER until it
   486		 * has a mipi_dsi_host to register its device to. So, we
   487		 * first register the DSI host during probe time, and then return
   488		 * -EPROBE_DEFER until the bridge is loaded. Probe will be called again
   489		 *  and then the rest of the driver initialization can proceed
   490		 *  afterwards and the bridge can be successfully attached.
   491		 */
   492		dsi_in = of_graph_get_endpoint_by_regs(dev->of_node, 0, 0);
   493		if (!dsi_in) {
   494			DRM_ERROR("Failed to get dsi_in node info from DT");
   495			return -EINVAL;
   496		}
   497		dsi_node = of_graph_get_remote_port_parent(dsi_in);
   498		if (!dsi_node) {
   499			of_node_put(dsi_in);
   500			DRM_ERROR("Failed to get dsi node from DT\n");
   501			return -EINVAL;
   502		}
   503	
   504		dsi_pdev = of_find_device_by_node(dsi_node);
   505		if (!dsi_pdev) {
   506			of_node_put(dsi_in);
   507			of_node_put(dsi_node);
   508			DRM_ERROR("Failed to get dsi platform device\n");
   509			return -EINVAL;
   510		}
   511	
   512		of_node_put(dsi_in);
   513		of_node_put(dsi_node);
   514		ret = kmb_dsi_host_bridge_init(get_device(&dsi_pdev->dev));
   515	
   516		if (ret == -EPROBE_DEFER) {
 > 517			of_dev_put(dsi_pdev);
   518			return -EPROBE_DEFER;
   519		} else if (ret) {
   520			of_dev_put(dsi_pdev);
   521			DRM_ERROR("probe failed to initialize DSI host bridge\n");
   522			return ret;
   523		}
   524	
   525		/* Create DRM device */
   526		kmb = devm_drm_dev_alloc(dev, &kmb_driver,
   527					 struct kmb_drm_private, drm);
   528		if (IS_ERR(kmb)) {
   529			of_dev_put(dsi_pdev);
   530			return PTR_ERR(kmb);
   531		}
   532	
   533		dev_set_drvdata(dev, &kmb->drm);
   534	
   535		/* Initialize MIPI DSI */
   536		kmb->kmb_dsi = kmb_dsi_init(dsi_pdev);
   537		if (IS_ERR(kmb->kmb_dsi)) {
   538			drm_err(&kmb->drm, "failed to initialize DSI\n");
   539			ret = PTR_ERR(kmb->kmb_dsi);
   540			goto err_free1;
   541		}
   542	
   543		kmb->kmb_dsi->dev = &dsi_pdev->dev;
   544		kmb->kmb_dsi->pdev = dsi_pdev;
   545		ret = kmb_hw_init(&kmb->drm, 0);
   546		if (ret)
   547			goto err_free1;
   548	
   549		ret = kmb_setup_mode_config(&kmb->drm);
   550		if (ret)
   551			goto err_free;
   552	
   553		ret = kmb_irq_install(&kmb->drm, kmb->irq_lcd);
   554		if (ret < 0) {
   555			drm_err(&kmb->drm, "failed to install IRQ handler\n");
   556			goto err_irq;
   557		}
   558	
   559		drm_kms_helper_poll_init(&kmb->drm);
   560	
   561		/* Register graphics device with the kernel */
   562		ret = drm_dev_register(&kmb->drm, 0);
   563		if (ret)
   564			goto err_register;
   565	
   566		return 0;
   567	
   568	 err_register:
   569		drm_kms_helper_poll_fini(&kmb->drm);
   570	 err_irq:
   571		pm_runtime_disable(kmb->drm.dev);
   572	 err_free:
   573		drm_crtc_cleanup(&kmb->crtc);
   574		drm_mode_config_cleanup(&kmb->drm);
   575	 err_free1:
   576		dev_set_drvdata(dev, NULL);
   577		kmb_dsi_host_unregister(kmb->kmb_dsi);
   578	
   579		of_dev_put(dsi_pdev);
   580	
   581		return ret;
   582	}
   583	

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

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

  reply	other threads:[~2021-11-20 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18  2:37 [PATCH] drm/kmb: fix potential memleak in error branch Bernard Zhao
2021-11-20 16:08 ` kernel test robot [this message]
2021-11-22  7:12 ` kernel test robot

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=202111210049.SogNkVBR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=airlied@linux.ie \
    --cc=anitha.chrisanthus@intel.com \
    --cc=bernard@vivo.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edmund.j.dea@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).