allocate_flower_entry: should check for null deref
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Sun, 21 Jul 2019 06:37:31 +0000 (01:37 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:12:46 +0000 (10:12 +0200)
commit56dc57c705efe743de9bb13b48ea3ea771213190
tree519206a27d23b352556db4d15f83ac3f5febd77e
parentf4cfdd46b3563ff33f167fd44b022e78981bcda8
allocate_flower_entry: should check for null deref

[ Upstream commit bb1320834b8a80c6ac2697ab418d066981ea08ba ]

allocate_flower_entry does not check for allocation success, but tries
to deref the result. I only moved the spin_lock under null check, because
 the caller is checking allocation's status at line 652.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c