Re: [PATCH v2 net] net: fddi: fix a possible null-ptr-deref

From: David Miller
Date: Fri Jun 08 2018 - 18:48:20 EST


From: YueHaibing <yuehaibing@xxxxxxxxxx>
Date: Fri, 8 Jun 2018 10:58:25 +0800

> bp->SharedMemAddr is set to NULL while bp->SharedMemSize lesser-or-equal 0,
> then memset will trigger null-ptr-deref.
>
> fix it by replacing pci_alloc_consistent with dma_zalloc_coherent.
>
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
> ---
> v1->v2: move from pci_dma* to dma_* as Christoph suggested

Applied.