From d37b69caf717c3e78eb3ca1ecc80ab4857ad8606 Mon Sep 17 00:00:00 2001 From: claudio Date: Wed, 19 Sep 2018 08:12:39 +0000 Subject: [PATCH] Free edid_buf after use so to fix possible memory leak. With and ok jsg@ --- sys/arch/armv7/omap/amdisplay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arch/armv7/omap/amdisplay.c b/sys/arch/armv7/omap/amdisplay.c index c61446f88f7..d61d3fdcec1 100644 --- a/sys/arch/armv7/omap/amdisplay.c +++ b/sys/arch/armv7/omap/amdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amdisplay.c,v 1.7 2017/10/25 14:34:22 kettenis Exp $ */ +/* $OpenBSD: amdisplay.c,v 1.8 2018/09/19 08:12:39 claudio Exp $ */ /* * Copyright (c) 2016 Ian Sutton * @@ -219,6 +219,8 @@ amdisplay_attach(struct device *parent, struct device *self, void *args) return; } + free(edid_buf, M_DEVBUF, EDID_LENGTH); + #ifdef LCD_DEBUG edid_print(&sc->sc_edid); #endif @@ -246,7 +248,6 @@ amdisplay_attach(struct device *parent, struct device *self, void *args) /* configure DMA framebuffer */ if (amdisplay_setup_dma(sc)) { printf("%s: couldn't allocate DMA framebuffer\n", DEVNAME(sc)); - free(edid_buf, M_DEVBUF, EDID_LENGTH); amdisplay_detach(self, 0); return; } -- 2.20.1