net/netvsc: fix rndis packet addresses
authorLong Li <longli@microsoft.com>
Fri, 18 Sep 2020 18:53:47 +0000 (11:53 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 21 Sep 2020 16:05:38 +0000 (18:05 +0200)
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 <sodey@rbbn.com>
Signed-off-by: Long Li <longli@microsoft.com>
drivers/net/netvsc/hn_rxtx.c

index 3e8d3b4..65f1aba 100644 (file)
@@ -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