From d676fedfbcec903620dbcd9bdffe8954c5238da3 Mon Sep 17 00:00:00 2001 From: Ed Maste 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); }