If drm_addmap() fails master_priv is leaked.
Coverity CID: 13195
Signed-off-by: Darren Jenkins <[email protected]>
diff --git drivers/gpu/drm/radeon/radeon_cp.c drivers/gpu/drm/radeon/radeon_cp.c
index 0b2f9c2..06123ba 100644
--- drivers/gpu/drm/radeon/radeon_cp.c
+++ drivers/gpu/drm/radeon/radeon_cp.c
@@ -2145,6 +2145,7 @@ int radeon_master_create(struct drm_device *dev, struct drm_master *master)
&master_priv->sarea);
if (ret) {
DRM_ERROR("SAREA setup failed\n");
+ kfree(master_priv);
return ret;
}
master_priv->sarea_priv = master_priv->sarea->handle + sizeof(struct drm_sarea);
On Wed, Dec 30, 2009 at 11:25 AM, Darren Jenkins
<[email protected]> wrote:
> If drm_addmap() fails master_priv is leaked.
>
I got a patch from Roel Kluin to fix this already, will push it out soon.
Dave.