lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 3 Jul 2011 12:25:31 +0200 (CEST)
From:	Jesper Juhl <>
cc:, Ben Skeggs <>,
	David Airlie <>,
	Francisco Jerez <>
Subject: [PATCH] nouveau: Do not leak in nv20_graph_create

If we return due to an unknown chipset in 
drivers/gpu/drm/nouveau/nv20_graph.c:nv20_graph_create() we'll leak the 
memory allocated to 'pgraph'.

This patch should fix the leak and it also disambiguates the "PGRAPH:
unknown chipset\n" error message - it's nice to be able to tell which
branch created the error which is impossible if the error messages are
100% identical.

Signed-off-by: Jesper Juhl <>
 drivers/gpu/drm/nouveau/nv20_graph.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

  Don't have the hardware, so compile tested only.

diff --git a/drivers/gpu/drm/nouveau/nv20_graph.c b/drivers/gpu/drm/nouveau/nv20_graph.c
index affc7d7..059ad65 100644
--- a/drivers/gpu/drm/nouveau/nv20_graph.c
+++ b/drivers/gpu/drm/nouveau/nv20_graph.c
@@ -752,6 +752,7 @@ nv20_graph_create(struct drm_device *dev)
 			pgraph->grctx_user = 0x0000;
+			kfree(pgraph);
 			NV_ERROR(dev, "PGRAPH: unknown chipset\n");
 			return 0;
@@ -773,7 +774,8 @@ nv20_graph_create(struct drm_device *dev)
 			pgraph->grctx_size = NV35_36_GRCTX_SIZE;
-			NV_ERROR(dev, "PGRAPH: unknown chipset\n");
+			kfree(pgraph);
+			NV_ERROR(dev, "PGRAPH: unknown chipset.\n");
 			return 0;

Jesper Juhl <>
Don't top-post
Plain text mails only, please.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists