pknock: fix PVSStudio static analyzer reports

V595 The 'peer' pointer was utilized before it was verified against
nullptr.
This commit is contained in:
Jan Engelhardt
2017-07-23 19:55:06 +02:00
parent 90b0f3a51f
commit 0a836e9677

View File

@@ -619,8 +619,9 @@ static void add_peer(struct peer *peer, struct xt_pknock_rule *rule)
*/ */
static void remove_peer(struct peer *peer) static void remove_peer(struct peer *peer)
{ {
if (peer == NULL)
return;
list_del(&peer->head); list_del(&peer->head);
if (peer != NULL)
kfree(peer); kfree(peer);
} }