]> git.baikalelectronics.ru Git - kernel.git/commit
net: xgene: fix possible NULL dereference in xgene_enet_free_desc_rings()
authorIyappan Subramanian <isubramanian@apm.com>
Thu, 21 Aug 2014 20:44:48 +0000 (13:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Aug 2014 18:25:25 +0000 (11:25 -0700)
commit0b8ef9df960970200b4ac459018c89c70f0b7566
tree63f2a818e6c45b0f862ca6be9171e57694993b5d
parentd531a1af1a3054716d330075c55af0d083ddcf8f
net: xgene: fix possible NULL dereference in xgene_enet_free_desc_rings()

A NULL pointer dereference is possible for the argument ring->buf_pool
which is passed to xgene_enet_free_desc_ring(), as ring could be NULL.

And now since NULL pointers are being checked for before the calls to
xgene_enet_free_desc_ring(), might as well take advantage of them and
not call the function if the argument would be NULL.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/xgene_enet_main.c