Skip to content

Commit

Permalink
net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err
Browse files Browse the repository at this point in the history
This error message can be triggered by userspace. Use NL_SET_ERR_MSG so
the message is returned to the user and to avoid polluting the kernel
logs. Additionally, change the return value from EFAULT to EBUSY to
better reflect the error (which has nothing to do with addressing).

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://lore.kernel.org/r/20240611154116.2643662-1-sean.anderson@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Sean Anderson authored and Jakub Kicinski committed Jun 12, 2024
1 parent 721478f commit 32b0660
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/xilinx/xilinx_axienet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1945,9 +1945,9 @@ axienet_ethtools_set_coalesce(struct net_device *ndev,
struct axienet_local *lp = netdev_priv(ndev);

if (netif_running(ndev)) {
netdev_err(ndev,
"Please stop netif before applying configuration\n");
return -EFAULT;
NL_SET_ERR_MSG(extack,
"Please stop netif before applying configuration");
return -EBUSY;
}

if (ecoalesce->rx_max_coalesced_frames)
Expand Down

0 comments on commit 32b0660

Please sign in to comment.