public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Tobias Jordan <kernel@cdqe.de>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Subject: Re: [PATCH] drm: of: fix leak of port_node
Date: Sat, 26 Sep 2020 09:56:37 +0800	[thread overview]
Message-ID: <202009260907.dd6dS0ZE%lkp@intel.com> (raw)
In-Reply-To: <20200925223700.GA26659@agrajag.zerfleddert.de>

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

Hi Tobias,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master v5.9-rc6 next-20200925]
[cannot apply to drm/drm-next]
[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/Tobias-Jordan/drm-of-fix-leak-of-port_node/20200926-063854
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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/9acba5320ef136e5d4a3b7563f4b5a362922c818
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Tobias-Jordan/drm-of-fix-leak-of-port_node/20200926-063854
        git checkout 9acba5320ef136e5d4a3b7563f4b5a362922c818
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

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

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/drm_of.c: In function 'drm_of_lvds_get_remote_pixels_type':
>> drivers/gpu/drm/drm_of.c:318:16: warning: passing argument 1 of 'of_node_put' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     318 |    of_node_put(port_node);
         |                ^~~~~~~~~
   In file included from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from include/linux/i2c.h:13,
                    from include/drm/drm_crtc.h:28,
                    from include/drm/drm_atomic.h:31,
                    from include/drm/drm_bridge.h:30,
                    from drivers/gpu/drm/drm_of.c:7:
   include/linux/of.h:122:45: note: expected 'struct device_node *' but argument is of type 'const struct device_node *'
     122 | extern void of_node_put(struct device_node *node);
         |                         ~~~~~~~~~~~~~~~~~~~~^~~~
   drivers/gpu/drm/drm_of.c:335:16: warning: passing argument 1 of 'of_node_put' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     335 |    of_node_put(port_node);
         |                ^~~~~~~~~
   In file included from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from include/linux/i2c.h:13,
                    from include/drm/drm_crtc.h:28,
                    from include/drm/drm_atomic.h:31,
                    from include/drm/drm_bridge.h:30,
                    from drivers/gpu/drm/drm_of.c:7:
   include/linux/of.h:122:45: note: expected 'struct device_node *' but argument is of type 'const struct device_node *'
     122 | extern void of_node_put(struct device_node *node);
         |                         ~~~~~~~~~~~~~~~~~~~~^~~~

vim +318 drivers/gpu/drm/drm_of.c

   302	
   303	static int drm_of_lvds_get_remote_pixels_type(
   304				const struct device_node *port_node)
   305	{
   306		struct device_node *endpoint = NULL;
   307		int pixels_type = -EPIPE;
   308	
   309		for_each_child_of_node(port_node, endpoint) {
   310			struct device_node *remote_port;
   311			int current_pt;
   312	
   313			if (!of_node_name_eq(endpoint, "endpoint"))
   314				continue;
   315	
   316			remote_port = of_graph_get_remote_port(endpoint);
   317			if (!remote_port) {
 > 318				of_node_put(port_node);
   319				return -EPIPE;
   320			}
   321	
   322			current_pt = drm_of_lvds_get_port_pixels_type(remote_port);
   323			of_node_put(remote_port);
   324			if (pixels_type < 0)
   325				pixels_type = current_pt;
   326	
   327			/*
   328			 * Sanity check, ensure that all remote endpoints have the same
   329			 * pixel type. We may lift this restriction later if we need to
   330			 * support multiple sinks with different dual-link
   331			 * configurations by passing the endpoints explicitly to
   332			 * drm_of_lvds_get_dual_link_pixel_order().
   333			 */
   334			if (!current_pt || pixels_type != current_pt) {
   335				of_node_put(port_node);
   336				return -EINVAL;
   337			}
   338		}
   339	
   340		return pixels_type;
   341	}
   342	

---
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: 65123 bytes --]

  reply	other threads:[~2020-09-26  1:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 22:37 [PATCH] drm: of: fix leak of port_node Tobias Jordan
2020-09-26  1:56 ` kernel test robot [this message]
2020-09-26 19:16 ` 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=202009260907.dd6dS0ZE%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel@cdqe.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /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