Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/ncsi: Fix gma flag setting after response

gma_flag was set at the time of GMA command request but it should
only be set after getting successful response. Movinng this flag
setting in GMA response handler.

This flag is used mainly for not repeating GMA command once
received MAC address.

Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vijay Khemka and committed by
David S. Miller
9e860947 f398efc1

+6 -3
-3
net/ncsi/ncsi-manage.c
··· 764 764 return -1; 765 765 } 766 766 767 - /* Set the flag for GMA command which should only be called once */ 768 - nca->ndp->gma_flag = 1; 769 - 770 767 /* Get Mac address from NCSI device */ 771 768 return nch->handler(nca); 772 769 }
+6
net/ncsi/ncsi-rsp.c
··· 627 627 saddr.sa_family = ndev->type; 628 628 ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; 629 629 memcpy(saddr.sa_data, &rsp->data[MLX_MAC_ADDR_OFFSET], ETH_ALEN); 630 + /* Set the flag for GMA command which should only be called once */ 631 + ndp->gma_flag = 1; 632 + 630 633 ret = ops->ndo_set_mac_address(ndev, &saddr); 631 634 if (ret < 0) 632 635 netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n"); ··· 673 670 eth_addr_inc((u8 *)saddr.sa_data); 674 671 if (!is_valid_ether_addr((const u8 *)saddr.sa_data)) 675 672 return -ENXIO; 673 + 674 + /* Set the flag for GMA command which should only be called once */ 675 + ndp->gma_flag = 1; 676 676 677 677 ret = ops->ndo_set_mac_address(ndev, &saddr); 678 678 if (ret < 0)