nouveau: free in error path if drmAvailable fails.
This was reported in coverity. Signed-off-by: Dave Airlie <airlied@redhat.com>main
parent
d23146f3f0
commit
cc088f1721
|
@ -46,8 +46,10 @@ nouveau_device_open_existing(struct nouveau_device **dev, int close,
|
||||||
nvdev->needs_close = close;
|
nvdev->needs_close = close;
|
||||||
|
|
||||||
ver = drmGetVersion(fd);
|
ver = drmGetVersion(fd);
|
||||||
if (!ver)
|
if (!ver) {
|
||||||
|
nouveau_device_close((void *)&nvdev);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ver->version_major == 0 && ver->version_patchlevel != 16) ||
|
if ((ver->version_major == 0 && ver->version_patchlevel != 16) ||
|
||||||
ver->version_major > 1) {
|
ver->version_major > 1) {
|
||||||
|
|
Loading…
Reference in New Issue