]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sctp: handle invalid error codes without calling BUG()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 9 Jun 2023 11:04:43 +0000 (14:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:29 +0000 (12:22 +0200)
commite9e62419e79726810ee4f6c1b1509ea0d6077af8
treef0fe176181ba2aaefd4bb87b2f89a598b43b8aa3
parent3714bb4a1df84395efce2f76b71b412a415b6c51
sctp: handle invalid error codes without calling BUG()

[ Upstream commit a0067dfcd9418fd3b0632bc59210d120d038a9c6 ]

The sctp_sf_eat_auth() function is supposed to return enum sctp_disposition
values but if the call to sctp_ulpevent_make_authkey() fails, it returns
-ENOMEM.

This results in calling BUG() inside the sctp_side_effects() function.
Calling BUG() is an over reaction and not helpful.  Call WARN_ON_ONCE()
instead.

This code predates git.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sctp/sm_sideeffect.c