From b3f5eba6f618eafe64f78e2b3ad6056d72254ab5 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 15 Jun 2019 13:18:36 +0800 Subject: [PATCH] u4b/audio: Fix panic by kfree(NULL) DragonFly's kfree(9) doesn't allow a NULL pointer, while FreeBSD's free(9) allows. Reported-by: tse Bug-report: #3192 --- sys/bus/u4b/audio/uaudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/bus/u4b/audio/uaudio.c b/sys/bus/u4b/audio/uaudio.c index 67a2911132..17cbcdabd8 100644 --- a/sys/bus/u4b/audio/uaudio.c +++ b/sys/bus/u4b/audio/uaudio.c @@ -5056,7 +5056,8 @@ uaudio_mixer_fill_info(struct uaudio_softc *sc, } while (i--); done: - kfree(iot, M_TEMP); + if (iot != NULL) + kfree(iot, M_TEMP); } static int -- 2.41.0