Commit 36b3faeb authored by Tom Denis's avatar Tom Denis Committed by Michel Dänzer
Browse files

Avoid use-after-free in amdgpu_kernel_open_fd()

If the device cannot be opened avoid re-using busid after it has been
Signed-off-by: Tom Denis's avatarTom St Denis <>
Reviewed-by: Christian König's avatarChristian König <>
Reviewed-by: default avatarAlex Deucher <>
Signed-off-by: Michel Dänzer <> (cosmetic fixups)
parent 8823c3d4
......@@ -127,13 +127,14 @@ static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn, struct pci_device *dev)
fd = drmOpen(NULL, busid);
if (fd == -1) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[drm] Failed to open DRM device for %s: %s\n",
busid, strerror(errno));
return fd;
/* Check that what we opened was a master or a master-capable FD,
* by setting the version of the interface we'll use to talk to it.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment