diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2016-04-22 12:28:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-24 21:31:58 +0300 |
commit | 497f358aa4c0d99b75ec204407389920d5e33ec5 (patch) | |
tree | 735124d9ec42abdf4776cc7d638bbe839ac9ac6e /drivers/net/macsec.c | |
parent | c10c63ea739bce3b8a6ab85c7bb472d900c9b070 (diff) | |
download | linux-497f358aa4c0d99b75ec204407389920d5e33ec5.tar.xz |
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: c09440f7dcb3 ("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>
Diffstat (limited to 'drivers/net/macsec.c')
-rw-r--r-- | drivers/net/macsec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 5f3ea8026074..2a2136b7d324 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -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(); |