From: Jan Engelhardt Date: Wed, 7 Oct 2009 21:59:41 +0000 (+0200) Subject: pknock: peer can never be NULL in the hash iterator X-Git-Tag: v1.19~2^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1dc7f960c78a612e0a35dbba8a85fd038ba71ce;p=thirdparty%2Fxtables-addons.git pknock: peer can never be NULL in the hash iterator Given that pos is non-NULL, list_entry won't make it NULL. --- diff --git a/extensions/xt_pknock.c b/extensions/xt_pknock.c index 7e50162..8d466ad 100644 --- a/extensions/xt_pknock.c +++ b/extensions/xt_pknock.c @@ -509,12 +509,9 @@ remove_rule(struct xt_pknock_mtinfo *info) hashtable_for_each_safe(pos, n, rule->peer_head, peer_hashsize, i) { peer = list_entry(pos, struct peer, head); - - if (peer != NULL) { - pk_debug("DELETED", peer); - list_del(pos); - kfree(peer); - } + pk_debug("DELETED", peer); + list_del(pos); + kfree(peer); } if (rule->status_proc != NULL)