macsec: fix rx_sa refcounting with decrypt callback
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 22 Apr 2016 09:28:04 +0000 (11:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Apr 2016 18:31:58 +0000 (14:31 -0400)
commitc3b7d0bd7ac2c501d4806db71ddd383c184968e8
tree8bc0ce1c27261b9857058fe24514c783b8879855
parent497f358aa4c0d99b75ec204407389920d5e33ec5
macsec: fix rx_sa refcounting with decrypt callback

The decrypt callback macsec_decrypt_done needs a reference on the rx_sa
and releases it before returning, but macsec_handle_frame already
put that reference after macsec_decrypt returned NULL.

Set rx_sa to NULL when the decrypt callback runs so that
macsec_handle_frame knows it must not release the reference.

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>
drivers/net/macsec.c