Skip to content

Commit

Permalink
sctp: do not pr_err for the duplicated node in transport rhlist
Browse files Browse the repository at this point in the history
The pr_err in sctp_hash_transport was supposed to report a sctp bug
for using rhashtable/rhlist.

The err '-EEXIST' introduced in Commit cd2b708 ("sctp: check
duplicate node before inserting a new transport") doesn't belong
to that case.

So just return -EEXIST back without pr_err any kmsg.

Fixes: cd2b708 ("sctp: check duplicate node before inserting a new transport")
Reported-by: Wei Chen <weichen@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xin Long authored and David S. Miller committed Feb 12, 2018
1 parent 1b12580 commit 27af86b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/sctp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,15 +897,12 @@ int sctp_hash_transport(struct sctp_transport *t)
rhl_for_each_entry_rcu(transport, tmp, list, node)
if (transport->asoc->ep == t->asoc->ep) {
rcu_read_unlock();
err = -EEXIST;
goto out;
return -EEXIST;
}
rcu_read_unlock();

err = rhltable_insert_key(&sctp_transport_hashtable, &arg,
&t->node, sctp_hash_params);

out:
if (err)
pr_err_once("insert transport fail, errno %d\n", err);

Expand Down

0 comments on commit 27af86b

Please sign in to comment.