Skip to content

Commit

Permalink
net: sctp: Deletion of an unnecessary check before the function call …
Browse files Browse the repository at this point in the history
…"kfree"

The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-By: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Markus Elfring authored and David S. Miller committed Feb 3, 2015
1 parent 193cdc4 commit 7d37d0c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ void sctp_association_free(struct sctp_association *asoc)
sctp_asconf_queue_teardown(asoc);

/* Free pending address space being deleted */
if (asoc->asconf_addr_del_pending != NULL)
kfree(asoc->asconf_addr_del_pending);
kfree(asoc->asconf_addr_del_pending);

/* AUTH - Free the endpoint shared keys */
sctp_auth_destroy_keys(&asoc->endpoint_shared_keys);
Expand Down

0 comments on commit 7d37d0c

Please sign in to comment.