⬢ DragonFlyBSD Kernel Audit
DF-2223 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/linux_pci.c
+++ b/sys/dev/drm/linux_pci.c
@@ -32,8 +32,10 @@
 	if (pos & 3)
 		return -EINVAL;
 
-	if (!pcie_capability_reg_implemented(dev, pos))
+	if (!pcie_capability_reg_implemented(dev, pos)) {
+		*dst = 0;
 		return -EINVAL;
+	}
 
 	return pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, dst);
 }