Message ID | 20220314112731.386214838@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57876C433FE for <stable@archiver.kernel.org>; Mon, 14 Mar 2022 11:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232300AbiCNLij (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 14 Mar 2022 07:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239276AbiCNLhp (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 14 Mar 2022 07:37:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B9B3424A9; Mon, 14 Mar 2022 04:36:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4053EB80DB7; Mon, 14 Mar 2022 11:36:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F60DC340E9; Mon, 14 Mar 2022 11:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647257779; bh=+WPrIMzukNoVwdaixGOAog3/ZFBM13vw5oMvPu2e6rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WFjrZbbz2ZWWNsXyY0IsVs3B8h2O3uq0k0lYaj/iXgjVa2KN4jKz7OtKX9ASJRpb6 Uubn0rUVjENHtFE65geERBFhvLQp7y4YmUH+Xih6pB8W5PXtgB4r1zgM82yKDYZ3lV 05hgoaSfpqDOMWSyB2wF9X3HH/nrgucYYQ8p8JOA= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, suresh kumar <suresh2514@gmail.com>, "David S. Miller" <davem@davemloft.net>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.14 11/23] net-sysfs: add check for netdevice being present to speed_show Date: Mon, 14 Mar 2022 12:34:24 +0100 Message-Id: <20220314112731.386214838@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112731.050583127@linuxfoundation.org> References: <20220314112731.050583127@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 7d8c6ba5cbd2..5ff47c5bc453 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -202,7 +202,7 @@ static ssize_t speed_show(struct device *dev, if (!rtnl_trylock()) return restart_syscall(); - if (netif_running(netdev)) { + if (netif_running(netdev) && netif_device_present(netdev)) { struct ethtool_link_ksettings cmd; if (!__ethtool_get_link_ksettings(netdev, &cmd))