DragonFlyBSD Kernel Audit
DF-1538 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/amd/amdgpu/gmc_v7_0.c
+++ b/sys/dev/drm/amd/amdgpu/gmc_v7_0.c
@@ -184,6 +184,8 @@
 	int i, ucode_size, regs_size;
 
 	if (!adev->gmc.fw)
+		return -EINVAL;
+	if (adev->gmc.fw->datasize < sizeof(*hdr))
 		return -EINVAL;
 
 	hdr = (const struct mc_firmware_header_v1_0 *)adev->gmc.fw->data;