Message ID | 20240624134607.1701-1-dkirjanov@suse.de (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net/dcb: check for detached device before executing callbacks | expand |
Hi, On Mon, 2024-06-24 at 09:46 -0400, Denis Kirjanov wrote: > 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: 2f90b8657ec94 ("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 <dkirjanov@suse.de> The patch LGTM, but please fix the patch sender to match the patch author to make checkpatch happy. ./scripts/checkpatch.pl --strict --git HEAD^.. before the submission is your friend:) Also please add the target tree ('net') in the subj prefix when you will submit the next revision. Thanks! Paolo
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 2e6b8c8fd2de..80b3b6ba5d3c 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1943,7 +1943,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, return -EINVAL; netdev = __dev_get_by_name(net, nla_data(tb[DCB_ATTR_IFNAME])); - if (!netdev) + if (!netdev || !netif_device_present(netdev)) return -ENODEV; if (!netdev->dcbnl_ops)