Re: [PATCH 01/18] drm/amd/display: improve the message printed when loading DC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 17/05/23 5:07 pm, Tom Chung wrote:
From: Aurabindo Pillai <aurabindo.pillai@xxxxxxx>

[Why&How]
Change how DC version and hardware version is printed when driver is
loaded.

- Remove exclamation
- Add DC version and hardware version to both success and failure cases
- Add version in between appropriate filler words to make a complete
   statement.

Reviewed-by: Harry Wentland <harry.wentland@xxxxxxx>
Acked-by: Tom Chung <chiahsuan.chung@xxxxxxx>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@xxxxxxx>
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 14b296e1d0f6..45b778631430 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1666,10 +1666,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
  	adev->dm.dc = dc_create(&init_data);
if (adev->dm.dc) {

	// Check for NULL
-		DRM_INFO("Display Core initialized with v%s! %s\n", DC_VER,
+		DRM_INFO("Display Core v%s initialized on %s\n", DC_VER,
  			 dce_version_to_string(adev->dm.dc->ctx->dce_version));
  	} else {
	// adev->dm.dc is NULL here

-		DRM_INFO("Display Core failed to initialize with v%s!\n", DC_VER);
+		DRM_INFO("Display Core v%s failed to initialize on %s\n", DC_VER,
+			 dce_version_to_string(adev->dm.dc->ctx->dce_version));						       ^^^^NULL deref bug here.

I found this using static analysis with smatch.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1673 amdgpu_dm_init() error: we previously assumed 'adev->dm.dc' could be null (see line 1669)

If you fix this could you please consider adding:

Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>

Thanks,
Harshit
														
					
  		goto error;
  	}



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux