public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/radeon/radeon_cp.c: fix resource leak on error
@ 2009-12-24 13:25 Darren Jenkins
  0 siblings, 0 replies; only message in thread
From: Darren Jenkins @ 2009-12-24 13:25 UTC (permalink / raw)
  To: David Airlie, dri-devel mailing list, Kernel Janitors
  Cc: Linux Kernel Mailing List

If drm_addmap() fails master_priv is leaked.


Coverity CID: 13195

Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c
b/drivers/gpu/drm/radeon/radeon_cp.c
index 0b2f9c2..06123ba 100644
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/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);



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-24 13:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-24 13:25 drivers/gpu/drm/radeon/radeon_cp.c: fix resource leak on error Darren Jenkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox