From: Amir Vadai Date: Tue, 14 Dec 2010 12:41:12 +0000 (+0200) Subject: sdp: remove 'reading beyond SKB' warning X-Git-Tag: v4.1.12-92~264^2~5^2~56 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a05dcaf40930212c6e0bf223147dca0162687913;p=users%2Fjedix%2Flinux-maple.git sdp: remove 'reading beyond SKB' warning This is a good sanity check, but could print a warning when a partially used SrcAvail skb is cancelled. This should be fixed in a way that will leave the sanity check, but need to make minimal changes before the GA. Signed-off-by: Amir Vadai --- diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c index 616fb72b5f4c..7824ebd6023e 100644 --- a/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/drivers/infiniband/ulp/sdp/sdp_main.c @@ -2354,8 +2354,8 @@ sdp_mid_data: goto found_ok_skb; if (unlikely(!(flags & MSG_PEEK))) { - sdp_warn(sk, "Trying to read beyond SKB\n"); - sdp_prf(sk, skb, "Aborting recv"); + /* Could happen when SrcAvail was canceled + * and transformed into DATA SKB */ goto skb_cleanup; } @@ -2507,6 +2507,10 @@ sdp_mid_data: sdp_dbg_data(sk, "done copied %d target %d\n", copied, target); sdp_do_posts(sdp_sk(sk)); + if (rx_sa && !ssk->rx_sa) { + /* SrcAvail canceled. Must not access local rx_sa */ + rx_sa = NULL; + } skip_copy: if (ssk->urg_data && after(ssk->copied_seq, ssk->urg_seq)) ssk->urg_data = 0;