All of lore.kernel.org
 help / color / mirror / Atom feed
* [skeggsb:00.01-disp 126/130] drivers/gpu/drm/nouveau/nouveau_dp.c:222 nouveau_dp_irq() warn: variable dereferenced before check 'outp' (see line 217)
@ 2021-03-05  1:05 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-03-05  1:05 UTC (permalink / raw)
  To: kbuild

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

TO: Ben Skeggs <bskeggs@redhat.com>

tree:   https://github.com/skeggsb/linux 00.01-disp
head:   7548db689355586b323cda41f8a429b02e27a63f
commit: a7186a377ff320f522afe73ebe616a3d7b7cd297 [126/130] drm/nouveau/disp: expose conn event class
:::::: branch date: 14 hours ago
:::::: commit date: 15 hours ago
config: i386-randconfig-m021-20210304 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/gpu/drm/nouveau/nouveau_dp.c:222 nouveau_dp_irq() warn: variable dereferenced before check 'outp' (see line 217)

vim +/outp +222 drivers/gpu/drm/nouveau/nouveau_dp.c

cf5a1a820e998d Ben Skeggs 2021-03-02  209  
a7186a377ff320 Ben Skeggs 2021-03-02  210  void
a7186a377ff320 Ben Skeggs 2021-03-02  211  nouveau_dp_irq(struct work_struct *work)
a0922278f83eae Lyude Paul 2020-08-26  212  {
a7186a377ff320 Ben Skeggs 2021-03-02  213  	struct nouveau_connector *nv_connector =
a7186a377ff320 Ben Skeggs 2021-03-02  214  		container_of(work, typeof(*nv_connector), irq_work);
a0922278f83eae Lyude Paul 2020-08-26  215  	struct drm_connector *connector = &nv_connector->base;
a0922278f83eae Lyude Paul 2020-08-26  216  	struct nouveau_encoder *outp = find_encoder(connector, DCB_OUTPUT_DP);
a7186a377ff320 Ben Skeggs 2021-03-02 @217  	struct nouveau_drm *drm = nouveau_drm(outp->base.base.dev);
a0922278f83eae Lyude Paul 2020-08-26  218  	struct nv50_mstm *mstm;
2a8d9e79efec0f Ben Skeggs 2021-03-02  219  	u64 hpd = 0;
a4efad354cf1b9 Lyude Paul 2020-08-26  220  	int ret;
a0922278f83eae Lyude Paul 2020-08-26  221  
a0922278f83eae Lyude Paul 2020-08-26 @222  	if (!outp)
a0922278f83eae Lyude Paul 2020-08-26  223  		return;
a0922278f83eae Lyude Paul 2020-08-26  224  
a0922278f83eae Lyude Paul 2020-08-26  225  	mstm = outp->dp.mstm;
a0922278f83eae Lyude Paul 2020-08-26  226  	NV_DEBUG(drm, "service %s\n", connector->name);
a0922278f83eae Lyude Paul 2020-08-26  227  
a0922278f83eae Lyude Paul 2020-08-26  228  	mutex_lock(&outp->dp.hpd_irq_lock);
a0922278f83eae Lyude Paul 2020-08-26  229  
a0922278f83eae Lyude Paul 2020-08-26  230  	if (mstm && mstm->is_mst) {
a0922278f83eae Lyude Paul 2020-08-26  231  		if (!nv50_mstm_service(drm, nv_connector, mstm))
a7186a377ff320 Ben Skeggs 2021-03-02  232  			hpd |= NVIF_CONN_EVENT_V0_UNPLUG;
a0922278f83eae Lyude Paul 2020-08-26  233  	} else {
a0922278f83eae Lyude Paul 2020-08-26  234  		drm_dp_cec_irq(&nv_connector->aux);
a4efad354cf1b9 Lyude Paul 2020-08-26  235  
a4efad354cf1b9 Lyude Paul 2020-08-26  236  		if (nouveau_dp_has_sink_count(connector, outp)) {
a4efad354cf1b9 Lyude Paul 2020-08-26  237  			ret = drm_dp_read_sink_count(&nv_connector->aux);
a4efad354cf1b9 Lyude Paul 2020-08-26  238  			if (ret != outp->dp.sink_count)
a7186a377ff320 Ben Skeggs 2021-03-02  239  				hpd |= NVIF_CONN_EVENT_V0_PLUG;
a4efad354cf1b9 Lyude Paul 2020-08-26  240  			if (ret >= 0)
a4efad354cf1b9 Lyude Paul 2020-08-26  241  				outp->dp.sink_count = ret;
a4efad354cf1b9 Lyude Paul 2020-08-26  242  		}
a0922278f83eae Lyude Paul 2020-08-26  243  	}
a0922278f83eae Lyude Paul 2020-08-26  244  
a0922278f83eae Lyude Paul 2020-08-26  245  	mutex_unlock(&outp->dp.hpd_irq_lock);
a4efad354cf1b9 Lyude Paul 2020-08-26  246  
a7186a377ff320 Ben Skeggs 2021-03-02  247  	nouveau_connector_hpd(nv_connector, NVIF_CONN_EVENT_V0_IRQ | hpd);
a0922278f83eae Lyude Paul 2020-08-26  248  }
a0922278f83eae Lyude Paul 2020-08-26  249  

:::::: The code at line 222 was first introduced by commit
:::::: a0922278f83eae085fdf73d06f71bbdfb9d6789e drm/nouveau/kms/nv50-: Refactor and cleanup DP HPD handling

:::::: TO: Lyude Paul <lyude@redhat.com>
:::::: CC: Lyude Paul <lyude@redhat.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [skeggsb:00.01-disp 126/130] drivers/gpu/drm/nouveau/nouveau_dp.c:222 nouveau_dp_irq() warn: variable dereferenced before check 'outp' (see line 217)
@ 2021-03-09  5:48 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-03-09  5:48 UTC (permalink / raw)
  To: kbuild

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

tree:   https://github.com/skeggsb/linux 00.01-disp
head:   7548db689355586b323cda41f8a429b02e27a63f
commit: a7186a377ff320f522afe73ebe616a3d7b7cd297 [126/130] drm/nouveau/disp: expose conn event class
config: i386-randconfig-m021-20210304 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/gpu/drm/nouveau/nouveau_dp.c:222 nouveau_dp_irq() warn: variable dereferenced before check 'outp' (see line 217)

vim +/outp +222 drivers/gpu/drm/nouveau/nouveau_dp.c

a7186a377ff320 Ben Skeggs 2021-03-02  210  void
a7186a377ff320 Ben Skeggs 2021-03-02  211  nouveau_dp_irq(struct work_struct *work)
a0922278f83eae Lyude Paul 2020-08-26  212  {
a7186a377ff320 Ben Skeggs 2021-03-02  213  	struct nouveau_connector *nv_connector =
a7186a377ff320 Ben Skeggs 2021-03-02  214  		container_of(work, typeof(*nv_connector), irq_work);
a0922278f83eae Lyude Paul 2020-08-26  215  	struct drm_connector *connector = &nv_connector->base;
a0922278f83eae Lyude Paul 2020-08-26  216  	struct nouveau_encoder *outp = find_encoder(connector, DCB_OUTPUT_DP);
a7186a377ff320 Ben Skeggs 2021-03-02 @217  	struct nouveau_drm *drm = nouveau_drm(outp->base.base.dev);
                                                                                      ^^^^^^^^^^^^^^^^^^^
Dereference

a0922278f83eae Lyude Paul 2020-08-26  218  	struct nv50_mstm *mstm;
2a8d9e79efec0f Ben Skeggs 2021-03-02  219  	u64 hpd = 0;
a4efad354cf1b9 Lyude Paul 2020-08-26  220  	int ret;
a0922278f83eae Lyude Paul 2020-08-26  221  
a0922278f83eae Lyude Paul 2020-08-26 @222  	if (!outp)
                                                    ^^^^^
Checked too late.

a0922278f83eae Lyude Paul 2020-08-26  223  		return;
a0922278f83eae Lyude Paul 2020-08-26  224  
a0922278f83eae Lyude Paul 2020-08-26  225  	mstm = outp->dp.mstm;
a0922278f83eae Lyude Paul 2020-08-26  226  	NV_DEBUG(drm, "service %s\n", connector->name);
a0922278f83eae Lyude Paul 2020-08-26  227  
a0922278f83eae Lyude Paul 2020-08-26  228  	mutex_lock(&outp->dp.hpd_irq_lock);
a0922278f83eae Lyude Paul 2020-08-26  229  
a0922278f83eae Lyude Paul 2020-08-26  230  	if (mstm && mstm->is_mst) {

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-09  5:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  1:05 [skeggsb:00.01-disp 126/130] drivers/gpu/drm/nouveau/nouveau_dp.c:222 nouveau_dp_irq() warn: variable dereferenced before check 'outp' (see line 217) kernel test robot
2021-03-09  5:48 Dan Carpenter

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.