summaryrefslogtreecommitdiff
path: root/freedreno
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2014-02-28 09:25:10 -0500
committerRob Clark <robclark@freedesktop.org>2014-03-05 09:40:19 -0500
commitcd1996470aa62116183485c5a3bf5754d69e3457 (patch)
tree48b874b0fa163b727c2c14f6a4c824f3cdd68802 /freedreno
parent5a3324638b3abb19b30e91ea4dfdd6e1764d6340 (diff)
freedreno: fix null ptr in error path
Signed-off-by: Rob Clark <robclark@freedesktop.org>
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;
}