mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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>
This commit is contained in:
committed by
Jakub Kicinski
parent
94adb5e29e
commit
6fdfdef7fd
@@ -38,8 +38,7 @@ static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq);
|
||||
/* 1st Level Abstractions */
|
||||
|
||||
/* Initialize a ULP queue from a block of memory. */
|
||||
struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
|
||||
struct sctp_association *asoc)
|
||||
void sctp_ulpq_init(struct sctp_ulpq *ulpq, struct sctp_association *asoc)
|
||||
{
|
||||
memset(ulpq, 0, sizeof(struct sctp_ulpq));
|
||||
|
||||
@@ -48,8 +47,6 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
|
||||
skb_queue_head_init(&ulpq->reasm_uo);
|
||||
skb_queue_head_init(&ulpq->lobby);
|
||||
ulpq->pd_mode = 0;
|
||||
|
||||
return ulpq;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user