aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie2011-10-19 11:39:54 -0500
committerDave Airlie2011-10-19 11:39:54 -0500
commitcc088f1721eaa5f8f1ba1932723882f92e34c39a (patch)
tree6d3a8145bb028eca5129b835f48cc61b4dcf21fd /nouveau
parentd23146f3f0ad14c8ad482a4832cae859c8d646f2 (diff)
downloadlibdrm-cc088f1721eaa5f8f1ba1932723882f92e34c39a.tar.gz
libdrm-cc088f1721eaa5f8f1ba1932723882f92e34c39a.tar.xz
libdrm-cc088f1721eaa5f8f1ba1932723882f92e34c39a.zip
nouveau: free in error path if drmAvailable fails.
This was reported in coverity. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/nouveau_device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nouveau/nouveau_device.c b/nouveau/nouveau_device.c
index 2ffcba6f..425c5d29 100644
--- a/nouveau/nouveau_device.c
+++ b/nouveau/nouveau_device.c
@@ -46,8 +46,10 @@ nouveau_device_open_existing(struct nouveau_device **dev, int close,
46 nvdev->needs_close = close; 46 nvdev->needs_close = close;
47 47
48 ver = drmGetVersion(fd); 48 ver = drmGetVersion(fd);
49 if (!ver) 49 if (!ver) {
50 nouveau_device_close((void *)&nvdev);
50 return -EINVAL; 51 return -EINVAL;
52 }
51 53
52 if ((ver->version_major == 0 && ver->version_patchlevel != 16) || 54 if ((ver->version_major == 0 && ver->version_patchlevel != 16) ||
53 ver->version_major > 1) { 55 ver->version_major > 1) {