Skip to content

Commit c59b892

Browse files
kda88guojinhui-liam
authored andcommitted
downstream: net/dcb: check for detached device before executing callbacks
When a netdevice is detached there is no point in trying to execute the dcb callbacks; at best they will return stale information, and at worst crash the machine. Fixes: 2f90b86 ("ixgbe: this patch adds support for DCB to the kernel and ixgbe driver") Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Haonan Fang <fanghaonan@bytedance.com>
1 parent 8a15247 commit c59b892

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/dcb/dcbnl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
19431943
return -EINVAL;
19441944

19451945
netdev = __dev_get_by_name(net, nla_data(tb[DCB_ATTR_IFNAME]));
1946-
if (!netdev)
1946+
if (!netdev || !netif_device_present(netdev))
19471947
return -ENODEV;
19481948

19491949
if (!netdev->dcbnl_ops)

0 commit comments

Comments
 (0)