From: Michael Chan Date: Mon, 22 Feb 2016 07:10:26 +0000 (-0500) Subject: bnxt_en: Fix zero padding of tx push data. X-Git-Tag: v4.1.12-92~126^2~68 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9d30d7e9ee933390ec9d6584cfc40e73523cec31;p=users%2Fjedix%2Flinux-maple.git bnxt_en: Fix zero padding of tx push data. Orabug: 23221795 The arithmetic to zero pad the last 64-bit word in the push buffer is not correct. 1. It should be pdata + length to get to the end. 2. 'pdata' is void pointer and passing it to PTR_ALIGN() will cast the aligned pointer to void. Pass 'end' which is u64 pointer to PTR_ALIGN() instead so that the aligned pointer - 1 is the last 64-bit pointer to data. Signed-off-by: Michael Chan Signed-off-by: David S. Miller (cherry picked from commit fbb0fa8b48892a3db8f5b89fb591c741fbd2fe7a) Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 4601d759e8d01..d5eb799ee6131 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -251,7 +251,8 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) tx_push1->tx_bd_cfa_meta = cpu_to_le32(vlan_tag_flags); tx_push1->tx_bd_cfa_action = cpu_to_le32(cfa_action); - end = PTR_ALIGN(pdata + length + 1, 8) - 1; + end = pdata + length; + end = PTR_ALIGN(end, 8) - 1; *end = 0; skb_copy_from_linear_data(skb, pdata, len);