diff options
author | Dave Airlie <airlied@redhat.com> | 2011-10-19 17:39:54 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-10-19 17:39:54 +0100 |
commit | cc088f1721eaa5f8f1ba1932723882f92e34c39a (patch) | |
tree | 6d3a8145bb028eca5129b835f48cc61b4dcf21fd | |
parent | d23146f3f0ad14c8ad482a4832cae859c8d646f2 (diff) | |
download | libdrm-cc088f1721eaa5f8f1ba1932723882f92e34c39a.tar.gz libdrm-cc088f1721eaa5f8f1ba1932723882f92e34c39a.tar.bz2 libdrm-cc088f1721eaa5f8f1ba1932723882f92e34c39a.zip |
nouveau: free in error path if drmAvailable fails.
This was reported in coverity.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | nouveau/nouveau_device.c | 4 |
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, nvdev->needs_close = close; ver = drmGetVersion(fd); - if (!ver) + if (!ver) { + nouveau_device_close((void *)&nvdev); return -EINVAL; + } if ((ver->version_major == 0 && ver->version_patchlevel != 16) || ver->version_major > 1) { |