All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/iccsense: fix memory leak on default sensor->type case
@ 2016-06-02 10:28 Colin King
  2016-06-02 22:28 ` Ben Skeggs
       [not found] ` <1464863332-9610-1-git-send-email-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Colin King @ 2016-06-02 10:28 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie, Martin Peres, Karol Herbst, dri-devel,
	nouveau
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The default sensor->type case leaks memory allocated to rail. Fix
this by free'ing rail before we continue with the next loop iteration.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
index 323c79a..79b0eb5 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
@@ -305,6 +305,7 @@ nvkm_iccsense_oneinit(struct nvkm_subdev *subdev)
 			rail->read = nvkm_iccsense_ina3221_read;
 			break;
 		default:
+			kfree(rail);
 			continue;
 		}
 
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-03 10:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-02 10:28 [PATCH] drm/nouveau/iccsense: fix memory leak on default sensor->type case Colin King
2016-06-02 22:28 ` Ben Skeggs
     [not found] ` <1464863332-9610-1-git-send-email-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2016-06-03  9:55   ` karol herbst
2016-06-03  9:55     ` [Nouveau] " karol herbst
2016-06-03 10:42     ` Colin Ian King
2016-06-03 10:42       ` Colin Ian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.