drivers/gpu/drm/nouveau/nouveau_dp.c:222 nouveau_dp_irq() warn: variable dereferenced before check 'outp' (see line 217)
PATCH 126/130 drivers/gpu/drm/nouveau/nouveau_dp.c:222 nouveau_dp_irq() warn: variable dereferenced before check 'outp' (see line 217)
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 <[email protected]>
Reported-by Dan Carpenter <[email protected]>
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