From 1ad85379c7dd0c1f1a1cdc70f322b716ec3b140c Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 30 Aug 2018 12:14:30 +0000 Subject: [PATCH] fix memory leak in an error path ok patrick@ --- sys/dev/fdt/imxanatop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/fdt/imxanatop.c b/sys/dev/fdt/imxanatop.c index a90b8014ca3..30475b935f2 100644 --- a/sys/dev/fdt/imxanatop.c +++ b/sys/dev/fdt/imxanatop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxanatop.c,v 1.4 2018/06/28 10:07:35 kettenis Exp $ */ +/* $OpenBSD: imxanatop.c,v 1.5 2018/08/30 12:14:30 jsg Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -196,8 +196,10 @@ imxanatop_attach_regulator(struct imxanatop_softc *sc, int node) ir->ir_max_voltage = OF_getpropint(node, "anatop-max-voltage", -1); if (ir->ir_reg_offset == -1 || ir->ir_vol_bit_shift == -1 || ir->ir_vol_bit_width == -1 || ir->ir_min_bit_val == -1 || - ir->ir_min_voltage == -1 || ir->ir_max_voltage == -1) + ir->ir_min_voltage == -1 || ir->ir_max_voltage == -1) { + free(ir, M_DEVBUF, sizeof(*ir)); return; + } ir->ir_delay_reg_offset = OF_getpropint(node, "anatop-delay-reg-offset", 0); -- 2.20.1