sds->attachment was written right after selection, before
config_attachment() ran, so a failed config call would leave it
reflecting a value that was never actually applied to hardware. Move
the assignment after the call succeeds, matching how sds->hw_mode is
only committed after set_hw_mode() succeeds.
Link: https://github.com/openwrt/openwrt/pull/24232
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
if (ret < 0)
return ret;
- sds->attachment = attachment;
-
ret = sds->ops->config_attachment(sds, attachment, hw_mode);
if (ret < 0)
return ret;
+
+ sds->attachment = attachment;
}
ret = sds->ops->set_hw_mode(sds, hw_mode);