ANDROID: Fix gki allmodconfig build errors in mptcp

In commit e93fa44f07 ("mptcp: fix duplicate data handling"), the logic
could potentially end up testing the variable 'incr' without first
setting it.  clang properly catches this error, but gcc doesn't, and
it's gone unnoticed upstream as well.

Fix this up by initializing the variable, which resolves the build.
Note that for GKI kernels, none of this matters as mptcp is not enabled
for that build.

Fixes: e93fa44f07 ("mptcp: fix duplicate data handling")
Change-Id: Ia619c1f9fed70f39b29cfdbd3143e0480fd2199d
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2024-09-09 15:50:23 +00:00
parent 0c105dabe6
commit 39a8a0618d

View File

@ -871,7 +871,7 @@ static void mptcp_subflow_discard_data(struct sock *ssk, struct sk_buff *skb,
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk); struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk);
bool fin = TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN; bool fin = TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN;
struct tcp_sock *tp = tcp_sk(ssk); struct tcp_sock *tp = tcp_sk(ssk);
u32 offset, incr, avail_len; u32 offset, incr = 0, avail_len;
offset = tp->copied_seq - TCP_SKB_CB(skb)->seq; offset = tp->copied_seq - TCP_SKB_CB(skb)->seq;
if (WARN_ON_ONCE(offset > skb->len)) if (WARN_ON_ONCE(offset > skb->len))