net: fddi: fix a possible null-ptr-deref
authorYueHaibing <yuehaibing@huawei.com>
Fri, 8 Jun 2018 02:58:25 +0000 (10:58 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Jun 2018 22:47:46 +0000 (18:47 -0400)
commit6310a882fbe0b87e0950222f2ac197ed92e11792
tree08c003839d82a89c3904bfc1639358f72fae525f
parent58d813afbe89658a5972747460a5fe19dec4dbcb
net: fddi: fix a possible null-ptr-deref

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@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/fddi/skfp/skfddi.c