Commit 1a89e24f authored by Parav Pandit's avatar Parav Pandit Committed by Jakub Kicinski

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: c0bea69d ("devlink: Validate port function request")
Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20240129191059.129030-1-parav@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f5c3eb4b
...@@ -674,7 +674,7 @@ static int devlink_port_function_validate(struct devlink_port *devlink_port, ...@@ -674,7 +674,7 @@ static int devlink_port_function_validate(struct devlink_port *devlink_port,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (tb[DEVLINK_PORT_FN_ATTR_STATE] && !ops->port_fn_state_set) { 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"); "Function does not support state setting");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment