mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Stafford Horne <shorne@gmail.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1699 amdgpu_dm_fini() error: we previously assumed 'adev->dm.dc' could be null (see line 1695)
Date: Mon, 12 Dec 2022 10:21:30 +0300	[thread overview]
Message-ID: <202212110728.v8ny7lxV-lkp@intel.com> (raw)

Hi Stafford,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   296a7b7eb79246912de31ee799cb85220931231a
commit: ded2ee36313c941f1a12b6f85cde295b575264ae openrisc: Add pci bus support
config: openrisc-randconfig-m031-20221210
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>

New smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1699 amdgpu_dm_fini() error: we previously assumed 'adev->dm.dc' could be null (see line 1695)

Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1726 amdgpu_dm_fini() warn: variable dereferenced before check 'adev->dm.dc' (see line 1699)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2707 dm_resume() error: we previously assumed 'aconnector->dc_link' could be null (see line 2694)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3995 amdgpu_dm_backlight_update_status() error: testing array offset 'i' after use.
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4037 amdgpu_dm_backlight_get_brightness() error: testing array offset 'i' after use.
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5409 fill_blending_from_plane_state() warn: variable dereferenced before check 'per_pixel_alpha' (see line 5384)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6504 create_stream_for_sink() error: we previously assumed 'aconnector->dc_sink' could be null (see line 6403)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8891 handle_cursor_update() error: we previously assumed 'afb' could be null (see line 8850)

vim +1699 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c

7578ecda14d521 Alex Deucher        2017-10-10  1667  static void amdgpu_dm_fini(struct amdgpu_device *adev)
4562236b3bc0a2 Harry Wentland      2017-09-12  1668  {
f74367e492ba24 Alex Deucher        2020-07-10  1669  	int i;
f74367e492ba24 Alex Deucher        2020-07-10  1670  
09a5df6c444cf0 Nicholas Kazlauskas 2021-08-03  1671  	if (adev->dm.vblank_control_workqueue) {
09a5df6c444cf0 Nicholas Kazlauskas 2021-08-03  1672  		destroy_workqueue(adev->dm.vblank_control_workqueue);
09a5df6c444cf0 Nicholas Kazlauskas 2021-08-03  1673  		adev->dm.vblank_control_workqueue = NULL;
09a5df6c444cf0 Nicholas Kazlauskas 2021-08-03  1674  	}
09a5df6c444cf0 Nicholas Kazlauskas 2021-08-03  1675  
f74367e492ba24 Alex Deucher        2020-07-10  1676  	for (i = 0; i < adev->dm.display_indexes_num; i++) {
f74367e492ba24 Alex Deucher        2020-07-10  1677  		drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
f74367e492ba24 Alex Deucher        2020-07-10  1678  	}
f74367e492ba24 Alex Deucher        2020-07-10  1679  
4562236b3bc0a2 Harry Wentland      2017-09-12  1680  	amdgpu_dm_destroy_drm_device(&adev->dm);
c8bdf2b63e5b6b Emily Deng          2019-05-27  1681  
9a65df19310859 Wayne Lin           2021-03-02  1682  #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
9a65df19310859 Wayne Lin           2021-03-02  1683  	if (adev->dm.crc_rd_wrk) {
9a65df19310859 Wayne Lin           2021-03-02  1684  		flush_work(&adev->dm.crc_rd_wrk->notify_ta_work);
9a65df19310859 Wayne Lin           2021-03-02  1685  		kfree(adev->dm.crc_rd_wrk);
9a65df19310859 Wayne Lin           2021-03-02  1686  		adev->dm.crc_rd_wrk = NULL;
9a65df19310859 Wayne Lin           2021-03-02  1687  	}
9a65df19310859 Wayne Lin           2021-03-02  1688  #endif
52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24  1689  #ifdef CONFIG_DRM_AMD_DC_HDCP
52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24  1690  	if (adev->dm.hdcp_workqueue) {
e96b1b2974989c Nirmoy Das          2021-02-10  1691  		hdcp_destroy(&adev->dev->kobj, adev->dm.hdcp_workqueue);
52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24  1692  		adev->dm.hdcp_workqueue = NULL;
52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24  1693  	}
52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24  1694  
52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24 @1695  	if (adev->dm.dc)
                                                            ^^^^^^^^^^^
Checked for NULL

52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24  1696  		dc_deinit_callbacks(adev->dm.dc);
52704fcaf74bc9 Bhawanpreet Lakha   2019-05-24  1697  #endif
51ba691206e354 Qingqing Zhuo       2021-03-09  1698  
9a71c7d31734f7 Nicholas Kazlauskas 2019-10-28 @1699  	dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
                                                                             ^^^^^^^^^^^
and then dereferenced without checking.

9a71c7d31734f7 Nicholas Kazlauskas 2019-10-28  1700  
81927e2808be5a Jude Shih           2021-04-20  1701  	if (dc_enable_dmub_notifications(adev->dm.dc)) {
81927e2808be5a Jude Shih           2021-04-20  1702  		kfree(adev->dm.dmub_notify);
81927e2808be5a Jude Shih           2021-04-20  1703  		adev->dm.dmub_notify = NULL;
e27c41d5b0681c Jude Shih           2021-07-25  1704  		destroy_workqueue(adev->dm.delayed_hpd_wq);
e27c41d5b0681c Jude Shih           2021-07-25  1705  		adev->dm.delayed_hpd_wq = NULL;
81927e2808be5a Jude Shih           2021-04-20  1706  	}
81927e2808be5a Jude Shih           2021-04-20  1707  
743b9786b14ae0 Nicholas Kazlauskas 2019-10-24  1708  	if (adev->dm.dmub_bo)

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


                 reply	other threads:[~2022-12-12  7:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202212110728.v8ny7lxV-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=shorne@gmail.com \
    /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

all inboxes | Powered by JetHome®