sctp: remove unnecessary NULL check in sctp_association_init()
authorAlexey Kodanev <aleksei.kodanev@bell-sw.com>
Wed, 19 Oct 2022 18:07:33 +0000 (21:07 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Oct 2022 04:43:10 +0000 (21:43 -0700)
commit6fdfdef7fdb57e6b9f768c9ca0718dcb5e727a85
treecf1ca7b722b461048b95f09a6ec88d4260ecf1f8
parent94adb5e29e0e583283183dbaa852ee9d7d0c4c26
sctp: remove unnecessary NULL check in sctp_association_init()

'&asoc->ulpq' passed to sctp_ulpq_init() as the first argument,
then sctp_qlpq_init() initializes it and eventually returns the
address of the struct member back. Therefore, in this case, the
return pointer cannot be NULL.

Moreover, it seems sctp_ulpq_init() has always been used only in
sctp_association_init(), so there's really no need to return ulpq
anymore.

Detected using the static analysis tool - Svace.
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/20221019180735.161388-1-aleksei.kodanev@bell-sw.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sctp/ulpqueue.h
net/sctp/associola.c
net/sctp/ulpqueue.c