<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Chunming Zhou <david1.zhou@amd.com><br>
<b>Sent:</b> Wednesday, December 13, 2017 4:03 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhou, David(ChunMing); Liu, Monk<br>
<b>Subject:</b> [PATCH] drm/amdgpu: fix NULL err for sriov detect</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">[ 21.841536] BUG: KASAN: null-ptr-deref in soc15_set_ip_blocks+0x4f/0x2e0 [amdgpu]<br>
<br>
Change-Id: I182dfed95c362123a75feafe44fa2ad3f3f35cac<br>
Signed-off-by: Chunming Zhou <david1.zhou@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +++++-----<br>
1 file changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
index a16e8d9a8fa2..49ff552cd6fe 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
@@ -521,6 +521,11 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)<br>
return -EINVAL;<br>
}<br>
<br>
+ if (adev->flags & AMD_IS_APU)<br>
+ adev->nbio_funcs = &nbio_v7_0_funcs;<br>
+ else<br>
+ adev->nbio_funcs = &nbio_v6_1_funcs;<br>
+<br>
adev->nbio_funcs->detect_hw_virt(adev);<br>
<br>
if (amdgpu_sriov_vf(adev))<br>
@@ -611,11 +616,6 @@ static int soc15_common_early_init(void *handle)<br>
<br>
adev->asic_funcs = &soc15_asic_funcs;<br>
<br>
- if (adev->flags & AMD_IS_APU)<br>
- adev->nbio_funcs = &nbio_v7_0_funcs;<br>
- else<br>
- adev->nbio_funcs = &nbio_v6_1_funcs;<br>
-<br>
if (amdgpu_get_ip_block(adev, AMD_IP_BLOCK_TYPE_PSP) &&<br>
(amdgpu_ip_block_mask & (1 << AMD_IP_BLOCK_TYPE_PSP)))<br>
psp_enabled = true;<br>
-- <br>
2.14.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk647341" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>