diff options
author | Vijay Khemka <vijaykhemka@fb.com> | 2019-12-27 23:43:49 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-12-31 05:34:17 +0100 |
commit | 9e860947d8d7a1504476ac49abfce90a4ce600f3 (patch) | |
tree | bbba4c0007f86d07a35e4609ccf97a96aea28d4a /net/ncsi/ncsi-rsp.c | |
parent | sctp: add enabled check for path tracepoint loop. (diff) | |
download | linux-9e860947d8d7a1504476ac49abfce90a4ce600f3.tar.xz linux-9e860947d8d7a1504476ac49abfce90a4ce600f3.zip |
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>
Diffstat (limited to 'net/ncsi/ncsi-rsp.c')
-rw-r--r-- | net/ncsi/ncsi-rsp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index d5611f04926d..a94bb59793f0 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -627,6 +627,9 @@ static int ncsi_rsp_handler_oem_mlx_gma(struct ncsi_request *nr) saddr.sa_family = ndev->type; ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; memcpy(saddr.sa_data, &rsp->data[MLX_MAC_ADDR_OFFSET], ETH_ALEN); + /* Set the flag for GMA command which should only be called once */ + ndp->gma_flag = 1; + ret = ops->ndo_set_mac_address(ndev, &saddr); if (ret < 0) netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n"); @@ -671,6 +674,9 @@ static int ncsi_rsp_handler_oem_bcm_gma(struct ncsi_request *nr) if (!is_valid_ether_addr((const u8 *)saddr.sa_data)) return -ENXIO; + /* Set the flag for GMA command which should only be called once */ + ndp->gma_flag = 1; + ret = ops->ndo_set_mac_address(ndev, &saddr); if (ret < 0) netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n"); |