We forget to free drm in all instances of failure, and additionally also
forget to destroy the master client if the other client fails
initialization.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ret = nouveau_cli_init(drm, "DRM-master", &drm->master);
if (ret)
- return ret;
+ goto fail_alloc;
ret = nouveau_cli_init(drm, "DRM", &drm->client);
if (ret)
- return ret;
+ goto fail_master;
dev->irq_enabled = true;
fail_ttm:
nouveau_vga_fini(drm);
nouveau_cli_fini(&drm->client);
+fail_master:
nouveau_cli_fini(&drm->master);
+fail_alloc:
kfree(drm);
return ret;
}