<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Am 23.04.24 um 04:53 schrieb Ma, Jun:<br>
<blockquote type="cite"
cite="mid:1cae725a-412d-4b28-b5a1-705e55157983@amd.com"><span
style="white-space: pre-wrap">
</span>
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> unsigned int client_id, src_id;
struct amdgpu_irq_src *src;
bool handled = false;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 924baf58e322..f0a63d084b4d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1559,7 +1559,7 @@ static int amdgpu_debugfs_firmware_info_show(struct seq_file *m, void *unused)
{
struct amdgpu_device *adev = m->private;
struct drm_amdgpu_info_firmware fw_info;
- struct drm_amdgpu_query_fw query_fw;
+ struct drm_amdgpu_query_fw query_fw = {0};
</pre>
</blockquote>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Coverity warning:
uninit_use_in_call Using uninitialized value query_fw.index when calling amdgpu_firmware_info
Even though qeuery_fw.index was assigned a value before it's used, there is still an coverity warning.
We need to initialize query_fw when declare it.</pre>
</blockquote>
<br>
But initializing it to zero doesn't sounds correct either.<br>
<br>
The amdgpu_firmware_info() function is designed to return the FW
info for a specific block, if the block isn't specified than
coverity is right that we have a coding error here.<br>
<br>
Just initializing the value silences coverity but is most likely not
the right thing to do.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<blockquote type="cite"
cite="mid:1cae725a-412d-4b28-b5a1-705e55157983@amd.com">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> struct atom_context *ctx = adev->mode_info.atom_context;
uint8_t smu_program, smu_major, smu_minor, smu_debug;
int ret, i;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
index 2b99eed5ba19..41ac3319108b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
@@ -120,7 +120,7 @@ static void __amdgpu_xcp_add_block(struct amdgpu_xcp_mgr *xcp_mgr, int xcp_id,
int amdgpu_xcp_init(struct amdgpu_xcp_mgr *xcp_mgr, int num_xcps, int mode)
{
struct amdgpu_device *adev = xcp_mgr->adev;
- struct amdgpu_xcp_ip ip;
+ struct amdgpu_xcp_ip ip = {0};
</pre>
</blockquote>
</blockquote>
<pre class="moz-quote-pre" wrap="">Coverity Warning:
Using uninitialized value ip. Field ip.valid is uninitialized when calling __amdgpu_xcp_add_block
The code is ok. We just need to initialize the variable ip.
Regards,
Ma Jun
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> uint8_t mem_id;
int i, j, ret;
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</blockquote>
<br>
</body>
</html>