macsec: don't put a NULL rxsa
The "deliver:" path of macsec_handle_frame can be called with
rx_sa == NULL. Check rx_sa != NULL before calling macsec_rxsa_put().
Fixes: c09440f7dc
("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c10c63ea73
commit
497f358aa4
|
@ -1161,7 +1161,8 @@ deliver:
|
|||
macsec_extra_len(macsec_skb_cb(skb)->has_sci));
|
||||
macsec_reset_skb(skb, secy->netdev);
|
||||
|
||||
macsec_rxsa_put(rx_sa);
|
||||
if (rx_sa)
|
||||
macsec_rxsa_put(rx_sa);
|
||||
count_rx(dev, skb->len);
|
||||
|
||||
rcu_read_unlock();
|
||||
|
|
Loading…
Reference in New Issue