]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
devlink: region: correct port region lookup to use port_ops
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Mon, 20 Oct 2025 17:09:13 +0000 (10:09 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 22 Oct 2025 00:40:26 +0000 (17:40 -0700)
The function devlink_port_region_get_by_name() incorrectly uses
region->ops->name to compare the region name. as it is not any critical
impact as ops and port_ops define as union for devlink_region but as per
code logic it should refer port_ops here.

No functional impact as ops and port_ops are part of same union,
and name is the first member of both.

Update it to use region->port_ops->name to properly reference
the name of the devlink port region.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20251020170916.1741808-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/devlink/region.c

index 63fb297f6d6785cd2d7f488b563e3a2f7dc3fefd..d6e5805cf3a0957efa12837f12d121b8c33663ad 100644 (file)
@@ -50,7 +50,7 @@ devlink_port_region_get_by_name(struct devlink_port *port,
        struct devlink_region *region;
 
        list_for_each_entry(region, &port->region_list, list)
-               if (!strcmp(region->ops->name, region_name))
+               if (!strcmp(region->port_ops->name, region_name))
                        return region;
 
        return NULL;