]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
devlink: fix condition for compat device info
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 11 Feb 2019 03:35:27 +0000 (19:35 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 04:39:55 +0000 (20:39 -0800)
We need the port to be both ethernet and have the rigth netdev,
not one or the other.

Fixes: ddb6e99e2db1 ("ethtool: add compat for devlink info")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c

index 0de1edb65c249efd31c6395e90a54da4b659cd34..61fab0dc0166ee5e27262835f1876dea4a090280 100644 (file)
@@ -6393,7 +6393,7 @@ void devlink_compat_running_version(struct net_device *dev,
        list_for_each_entry(devlink, &devlink_list, list) {
                mutex_lock(&devlink->lock);
                list_for_each_entry(devlink_port, &devlink->port_list, list) {
-                       if (devlink_port->type == DEVLINK_PORT_TYPE_ETH ||
+                       if (devlink_port->type == DEVLINK_PORT_TYPE_ETH &&
                            devlink_port->type_dev == dev) {
                                __devlink_compat_running_version(devlink,
                                                                 buf, len);