Patch "net: ipa: certain dropped packets aren't accounted for" has been added to the 5.17-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: ipa: certain dropped packets aren't accounted for

to the 5.17-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-ipa-certain-dropped-packets-aren-t-accounted-for.patch
and it can be found in the queue-5.17 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7feaa42b0b802e9f0b50eb77ae0bab95559a2b57
Author: Alex Elder <elder@xxxxxxxxxx>
Date:   Thu May 12 10:10:31 2022 -0500

    net: ipa: certain dropped packets aren't accounted for
    
    [ Upstream commit 30b338ff7998b6ed7a90815870cd5db725f87168 ]
    
    If an RX endpoint receives packets containing status headers, and a
    packet in the buffer is not dropped, ipa_endpoint_skb_copy() is
    responsible for wrapping the packet data in an SKB and forwarding it
    to ipa_modem_skb_rx() for further processing.
    
    If ipa_endpoint_skb_copy() gets a null pointer from build_skb(), it
    just returns early.  But in the process it doesn't record that as a
    dropped packet in the network device statistics.
    
    Instead, call ipa_modem_skb_rx() whether or not the SKB pointer is
    NULL; that function ensures the statistics are properly updated.
    
    Fixes: 1b65bbcc9a710 ("net: ipa: skip SKB copy if no netdev")
    Signed-off-by: Alex Elder <elder@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c
index 68291a3efd04..2ecfc17544a6 100644
--- a/drivers/net/ipa/ipa_endpoint.c
+++ b/drivers/net/ipa/ipa_endpoint.c
@@ -1169,13 +1169,12 @@ static void ipa_endpoint_skb_copy(struct ipa_endpoint *endpoint,
 		return;
 
 	skb = __dev_alloc_skb(len, GFP_ATOMIC);
-	if (!skb)
-		return;
-
-	/* Copy the data into the socket buffer and receive it */
-	skb_put(skb, len);
-	memcpy(skb->data, data, len);
-	skb->truesize += extra;
+	if (skb) {
+		/* Copy the data into the socket buffer and receive it */
+		skb_put(skb, len);
+		memcpy(skb->data, data, len);
+		skb->truesize += extra;
+	}
 
 	ipa_modem_skb_rx(endpoint->netdev, skb);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux