PAE: Silence static analyzer warning about NULL pointer dereference

ieee802_1x_kay_move_live_peer() did not check
ieee802_1x_kay_get_potential_peer() result explicitly and a static
analyzer reported a warning about the possible NULL result. This cannot
really happen in practice since the only caller of
ieee802_1x_kay_move_live_peer() verifies that the specific peer entry is
available. Anyway, it is easy to silence the false warning by adding an
explicit check here and cover any other potential case if another caller
is added.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Ranga Ravuri 2017-04-24 11:38:10 +03:00 committed by Jouni Malinen
parent 9a72bfe9a4
commit 9f894823fa

View file

@ -633,6 +633,8 @@ ieee802_1x_kay_move_live_peer(struct ieee802_1x_mka_participant *participant,
struct receive_sc *rxsc; struct receive_sc *rxsc;
peer = ieee802_1x_kay_get_potential_peer(participant, mi); peer = ieee802_1x_kay_get_potential_peer(participant, mi);
if (!peer)
return NULL;
rxsc = ieee802_1x_kay_init_receive_sc(&participant->current_peer_sci); rxsc = ieee802_1x_kay_init_receive_sc(&participant->current_peer_sci);
if (!rxsc) if (!rxsc)