]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: remove 'reading beyond SKB' warning
authorAmir Vadai <amirv@mellanox.co.il>
Tue, 14 Dec 2010 12:41:12 +0000 (14:41 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:36 +0000 (05:05 -0700)
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 <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_main.c

index 616fb72b5f4c27fa26a27e73d06efc96c9be0251..7824ebd6023e3e8ceff4415419078509cf613c71 100644 (file)
@@ -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;