diff mbox series

[5/5] drm/tegra: check root dentry before debugfs init

Message ID 20211008091704.27094-5-nirmoy.das@amd.com (mailing list archive)
State New, archived
Headers show
Series [1/5] dri: cleanup debugfs error handling | expand

Commit Message

Das, Nirmoy Oct. 8, 2021, 9:17 a.m. UTC
Return early if crtc or connector's debugfs root dentries are NULL.

CC: Thierry Reding <thierry.reding@gmail.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Jonathan Hunter <jonathanh@nvidia.com>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/tegra/dc.c   | 5 +++++
 drivers/gpu/drm/tegra/dsi.c  | 4 ++++
 drivers/gpu/drm/tegra/hdmi.c | 5 +++++
 drivers/gpu/drm/tegra/sor.c  | 4 ++++
 4 files changed, 18 insertions(+)

--
2.32.0

Comments

kernel test robot Nov. 8, 2021, 6:35 a.m. UTC | #1
Hi Nirmoy,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on tegra/for-next drm-tip/drm-tip linus/master v5.15 next-20211108]
[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/Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm64-randconfig-r012-20211008 (attached as .config)
compiler: aarch64-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/313e208057ad9c5d5de6c0fdb03fb575f71270e3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
        git checkout 313e208057ad9c5d5de6c0fdb03fb575f71270e3
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/tegra/

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/tegra/dc.c: In function 'tegra_dc_late_register':
>> drivers/gpu/drm/tegra/dc.c:1626:18: error: 'struct drm_crtc' has no member named 'debugfs_entry'
    1626 |         if (!crtc->debugfs_entry) {
         |                  ^~
   drivers/gpu/drm/tegra/dc.c: In function 'tegra_crtc_update_memory_bandwidth':
   drivers/gpu/drm/tegra/dc.c:1853:53: warning: variable 'new_dc_state' set but not used [-Wunused-but-set-variable]
    1853 |         const struct tegra_dc_state *old_dc_state, *new_dc_state;
         |                                                     ^~~~~~~~~~~~
   drivers/gpu/drm/tegra/dc.c:1853:38: warning: variable 'old_dc_state' set but not used [-Wunused-but-set-variable]
    1853 |         const struct tegra_dc_state *old_dc_state, *new_dc_state;
         |                                      ^~~~~~~~~~~~
   drivers/gpu/drm/tegra/dc.c: In function 'tegra_crtc_calculate_memory_bandwidth':
   drivers/gpu/drm/tegra/dc.c:2233:38: warning: variable 'old_state' set but not used [-Wunused-but-set-variable]
    2233 |         const struct drm_crtc_state *old_state;
         |                                      ^~~~~~~~~


vim +1626 drivers/gpu/drm/tegra/dc.c

  1618	
  1619	static int tegra_dc_late_register(struct drm_crtc *crtc)
  1620	{
  1621		unsigned int i, count = ARRAY_SIZE(debugfs_files);
  1622		struct drm_minor *minor = crtc->dev->primary;
  1623		struct dentry *root;
  1624		struct tegra_dc *dc = to_tegra_dc(crtc);
  1625	
> 1626		if (!crtc->debugfs_entry) {
  1627			dc->debugfs_files = NULL;
  1628			return 0;
  1629		}
  1630	

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

Patch

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 16c7aabb94d3..87eeda68d231 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1623,6 +1623,11 @@  static int tegra_dc_late_register(struct drm_crtc *crtc)
 	struct dentry *root;
 	struct tegra_dc *dc = to_tegra_dc(crtc);

+	if (!crtc->debugfs_entry) {
+		dc->debugfs_files = NULL;
+		return 0;
+	}
+
 #ifdef CONFIG_DEBUG_FS
 	root = crtc->debugfs_entry;
 #else
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index f46d377f0c30..f0263165e261 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -236,6 +236,10 @@  static int tegra_dsi_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_dsi *dsi = to_dsi(output);

+	if (!root) {
+		dsi->debugfs_files = NULL;
+		return 0;
+	}
 	dsi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
 	if (!dsi->debugfs_files)
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index e5d2a4026028..400319db0afc 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1065,6 +1065,11 @@  static int tegra_hdmi_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_hdmi *hdmi = to_hdmi(output);

+	if (!root) {
+		hdmi->debugfs_files = NULL;
+		return 0;
+	}
+
 	hdmi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				      GFP_KERNEL);
 	if (!hdmi->debugfs_files)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 0ea320c1092b..a8a3b0a587d9 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1687,6 +1687,10 @@  static int tegra_sor_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_sor *sor = to_sor(output);

+	if (!root) {
+		sor->debugfs_files = NULL;
+		return 0;
+	}
 	sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
 	if (!sor->debugfs_files)