From 166a246a1e0cde4330bb300d8f19c17bda088428 Mon Sep 17 00:00:00 2001 From: Sebastien Marie Date: Sun, 27 Sep 2015 10:12:10 +0000 Subject: free(x, 0) cleanup: - set size argument of free() - remove pointless if expression around free() call ok guenther@ --- sys/arch/zaurus/dev/zaurus_flash.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sys/arch/zaurus') diff --git a/sys/arch/zaurus/dev/zaurus_flash.c b/sys/arch/zaurus/dev/zaurus_flash.c index 1a474642718..32a12999e90 100644 --- a/sys/arch/zaurus/dev/zaurus_flash.c +++ b/sys/arch/zaurus/dev/zaurus_flash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_flash.c,v 1.13 2014/07/12 18:44:43 tedu Exp $ */ +/* $OpenBSD: zaurus_flash.c,v 1.14 2015/09/27 10:12:09 semarie Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler @@ -583,15 +583,13 @@ zflash_write_strategy(struct zflash_softc *sc, struct buf *bp, } bp->b_resid = bp->b_bcount - sc->sc_flash.sc_flashdev->pagesize; - free(oob, M_DEVBUF, 0); - free(buf, M_DEVBUF, 0); + free(oob, M_DEVBUF, oobsize); + free(buf, M_DEVBUF, bufsize); return; bad: bp->b_flags |= B_ERROR; - if (oob != NULL) - free(oob, M_DEVBUF, 0); - if (buf != NULL) - free(buf, M_DEVBUF, 0); + free(oob, M_DEVBUF, oobsize); + free(buf, M_DEVBUF, bufsize); } int -- cgit v1.2.3