[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231007005104.3994678-1-make_ruc2021@163.com>
Date: Sat, 7 Oct 2023 08:51:04 +0800
From: Ma Ke <make_ruc2021@....com>
To: richard@....at, anton.ivanov@...bridgegreys.com,
johannes@...solutions.net, xiangyang3@...wei.com,
make_ruc2021@....com
Cc: linux-um@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] um: vector: fix return value check in vector_mmsg_rx
In vector_mmsg_rx, to avoid an unexpected result returned by
pskb_trim, we should check the return value of pskb_trim().
Signed-off-by: Ma Ke <make_ruc2021@....com>
---
arch/um/drivers/vector_kern.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 131b7cb29576..c280ce5ea6ce 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1013,8 +1013,8 @@ static int vector_mmsg_rx(struct vector_private *vp, int budget)
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
}
- pskb_trim(skb,
- mmsg_vector->msg_len - vp->rx_header_size);
+ if (pskb_trim(skb, mmsg_vector->msg_len - vp->rx_header_size))
+ return 0;
skb->protocol = eth_type_trans(skb, skb->dev);
/*
* We do not need to lock on updating stats here
--
2.37.2
Powered by blists - more mailing lists