summaryrefslogtreecommitdiff
path: root/freedreno
diff options
context:
space:
mode:
Diffstat (limited to 'freedreno')
-rw-r--r--freedreno/freedreno_device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c
index 532e65bb..598bdfbc 100644
--- a/freedreno/freedreno_device.c
+++ b/freedreno/freedreno_device.c
@@ -117,7 +117,8 @@ struct fd_device * fd_device_new(int fd)
struct fd_device * fd_device_new_dup(int fd)
{
struct fd_device *dev = fd_device_new(dup(fd));
- dev->closefd = 1;
+ if (dev)
+ dev->closefd = 1;
return dev;
}