Skip to contentSkip to conversation

devlink: Fix referring to hw_addr attribute during state validation

PATCH Applied Parav Pandit 2 participants 2 messages Jan 29, 2024 – Jan 31, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devlink: Fix referring to hw_addr attribute during state validation

When port function state change is requested, and when the driver does not support it, it refers to the hw address attribute instead of state attribute. Seems like a copy paste error.

Fix it by referring to the port function state attribute.

Fixes c0bea69d1ca7 ("devlink: Validate port function request")
---
 net/devlink/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/devlink/port.c +1 -1
index 62e54e152ecf..78592912f657 100644
@@ -674,7 +674,7 @@ static int devlink_port_function_validate(struct devlink_port *devlink_port,
 		return -EOPNOTSUPP;
 	}
 	if (tb[DEVLINK_PORT_FN_ATTR_STATE] && !ops->port_fn_state_set) {
-		NL_SET_ERR_MSG_ATTR(extack, tb[DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR],
+		NL_SET_ERR_MSG_ATTR(extack, tb[DEVLINK_PORT_FN_ATTR_STATE],
 				    "Function does not support state setting");
 		return -EOPNOTSUPP;
 	}
Signature · 1 line
2.26.2
#1 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Mon, 29 Jan 2024 21:10:59 +0200 you wrote:

When port function state change is requested, and when the driver does not support it, it refers to the hw address attribute instead of state attribute. Seems like a copy paste error.

Fix it by referring to the port function state attribute.

Fixes c0bea69d1ca7 ("devlink: Validate port function request")

[...]

Here is the summary with links:
- [net] devlink: Fix referring to hw_addr attribute during state validation

    https://git.kernel.org/netdev/net/c/1a89e24f8bfd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html