From 8c95558f9f6cc376a051942411d050391469adc0 Mon Sep 17 00:00:00 2001 From: emaste Date: Fri, 30 Aug 2019 00:40:08 +0000 Subject: [PATCH] xdma: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/dev/xdma/xdma_sg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/xdma/xdma_sg.c b/sys/dev/xdma/xdma_sg.c index d057ff3bb000..b02b7d9d3e94 100644 --- a/sys/dev/xdma/xdma_sg.c +++ b/sys/dev/xdma/xdma_sg.c @@ -186,8 +186,7 @@ xchan_bufs_alloc(xdma_channel_t *xchan) xdma = xchan->xdma; if (xdma == NULL) { - device_printf(xdma->dev, - "%s: Channel was not allocated properly.\n", __func__); + printf("%s: Channel was not allocated properly.\n", __func__); return (-1); }