diff mbox

[5/8] mka: add error handling around move_live_peer

Message ID 6f91250003ffc63bad1a0bb68e424fd094a3c92c.1467374899.git.sd@queasysnail.net
State Accepted
Headers show

Commit Message

Sabrina Dubroca July 19, 2016, 9:56 a.m. UTC
ieee802_1x_kay_move_live_peer can fail. In that case, we should not
proceed.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 src/pae/ieee802_1x_kay.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
index 60270cad138e..5b4e05a25c61 100644
--- a/src/pae/ieee802_1x_kay.c
+++ b/src/pae/ieee802_1x_kay.c
@@ -3016,9 +3016,10 @@  static int ieee802_1x_kay_decode_mkpdu(struct ieee802_1x_kay *kay,
 		}
 		if (ieee802_1x_kay_is_in_potential_peer(
 			    participant, participant->current_peer_id.mi)) {
-			ieee802_1x_kay_move_live_peer(
-				participant, participant->current_peer_id.mi,
-				be_to_host32(participant->current_peer_id.mn));
+			if (!ieee802_1x_kay_move_live_peer(
+					participant, participant->current_peer_id.mi,
+					be_to_host32(participant->current_peer_id.mn)))
+				return -1;
 			ieee802_1x_kay_elect_key_server(participant);
 			ieee802_1x_kay_decide_macsec_use(participant);
 		}