]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pds_core: reject component parameter in legacy firmware update
authorNikhil P. Rao <nikhil.rao@amd.com>
Wed, 8 Jul 2026 16:36:49 +0000 (16:36 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 21 Jul 2026 13:01:20 +0000 (15:01 +0200)
The legacy firmware update path does not support per-component updates.
If a user specifies a component parameter with devlink flash, reject
the request with -EOPNOTSUPP rather than silently ignoring the component
parameter and flashing the entire firmware image.

Fixes: 49ce92fbee0b ("pds_core: add FW update feature to devlink")
Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260708163649.128620-1-nikhil.rao@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/amd/pds_core/devlink.c

index 2ea97e1c5939c0669e8b65371789a8e60dc26cbc..8adae7b18898db761524648c6c03e7fe98150a18 100644 (file)
@@ -90,6 +90,12 @@ int pdsc_dl_flash_update(struct devlink *dl,
 {
        struct pdsc *pdsc = devlink_priv(dl);
 
+       if (params->component) {
+               NL_SET_ERR_MSG_MOD(extack,
+                                  "Component update not supported by this device");
+               return -EOPNOTSUPP;
+       }
+
        return pdsc_firmware_update(pdsc, params->fw, extack);
 }