From: Long Li Date: Fri, 18 Sep 2020 18:53:47 +0000 (-0700) Subject: net/netvsc: fix rndis packet addresses X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d9fecbe97ba7c1ad0dedf33910d8b4e4e444979a;p=dpdk.git net/netvsc: fix rndis packet addresses The address should be calculated before type cast, not after. Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors") Cc: stable@dpdk.org Reported-by: Souvik Dey Signed-off-by: Long Li --- diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 3e8d3b407d..65f1abae51 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -160,8 +160,8 @@ static void hn_txd_init(struct rte_mempool *mp __rte_unused, txd->queue_id = txq->queue_id; txd->chim_index = NVS_CHIM_IDX_INVALID; - txd->rndis_pkt = (struct rndis_packet_msg *)(char *)txq->tx_rndis - + idx * HN_RNDIS_PKT_ALIGNED; + txd->rndis_pkt = (struct rndis_packet_msg *)((char *)txq->tx_rndis + + idx * HN_RNDIS_PKT_ALIGNED); } int