liquidio: read sc->iq_no before release sc
authorPan Bian <bianpan2016@163.com>
Wed, 28 Nov 2018 23:54:22 +0000 (07:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Dec 2018 13:15:17 +0000 (14:15 +0100)
commitb0cf59188ec238b2110332d3ead4ac7910968403
tree84c0d4c4bcb52d99b2cc6db09c04bc3ad19e5819
parent85099bea974387501dcde072e2eccb7317ec59ee
liquidio: read sc->iq_no before release sc

[ Upstream commit c0f53771ba45745e5870daf880127925c93f232f ]

The function lio_vf_rep_packet_sent_callback releases the occupation of
sc via octeon_free_soft_command. sc should not be used after that.
Unfortunately, sc->iq_no is read. To fix this, the patch stores sc->iq_no
into a local variable before releasing sc and then uses the local variable
instead of sc->iq_no.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c