diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2016-04-22 11:28:03 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-24 20:31:58 +0200 |
commit | 497f358aa4c0d99b75ec204407389920d5e33ec5 (patch) | |
tree | 735124d9ec42abdf4776cc7d638bbe839ac9ac6e /drivers/net/macsec.c | |
parent | macsec: take rtnl lock before for_each_netdev (diff) | |
download | linux-497f358aa4c0d99b75ec204407389920d5e33ec5.tar.xz linux-497f358aa4c0d99b75ec204407389920d5e33ec5.zip |
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(); |