From patchwork Tue Dec 5 15:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Chmielewski X-Patchwork-Id: 13480334 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D8SQavk1" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90E72BA for ; Tue, 5 Dec 2023 07:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701790472; x=1733326472; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xKJsV2VIWWPX82sNFGSjSZGbewbDfqmBqUfrgSjb0eQ=; b=D8SQavk1YcLKEsfYSBLWW4vVfpa/yLm9FpAGpWysaG1xRhoYRlCWk5bp PcQG1BtcLqoQ8tV762j+xtgfg8VUnSyWJQyrWUGZzd9DAidcc30Iq0ukG QXq5uedtDaBEqiNb8yLjK00bj541NPQ2kA9JXuAWcaY0xOpT6Hv/UnY3+ sIKizI+AR/CCwzu2F6W3JvoSYgoY/YFRgnkApliVR/BzU1ir/Lhp/I3ZN COG5kWg1BF2JccuEvJ0l2lj+XIf5TsKhcrtpW/hp1/wNKkgpvdVatv6oe /h+Qydv6TcKlM2J7NTyGvUZXj6rincjakB0XkzQ5R0igEaxN49Np959Fz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="378935328" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="378935328" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 07:34:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="894416023" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="894416023" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orsmga004.jf.intel.com with ESMTP; 05 Dec 2023 07:34:29 -0800 Received: from baltimore.igk.intel.com (baltimore.igk.intel.com [10.102.21.1]) by irvmail002.ir.intel.com (Postfix) with ESMTP id E64A1369E5; Tue, 5 Dec 2023 15:34:28 +0000 (GMT) From: Pawel Chmielewski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, Ngai-Mint Kwan , Mateusz Polchlopek , Pawel Chmielewski Subject: [PATCH iwl-next] ice: Do not get coalesce settings while in reset Date: Tue, 5 Dec 2023 16:26:20 +0100 Message-Id: <20231205152620.568183-1-pawel.chmielewski@intel.com> X-Mailer: git-send-email 2.37.3 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Ngai-Mint Kwan Getting coalesce settings while reset is in progress can cause NULL pointer deference bug. If under reset, abort get coalesce for ethtool. Signed-off-by: Ngai-Mint Kwan Reviewed-by: Mateusz Polchlopek Signed-off-by: Pawel Chmielewski --- drivers/net/ethernet/intel/ice/ice_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index bde9bc74f928..2d565cc484a0 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -3747,6 +3747,9 @@ __ice_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec, struct ice_netdev_priv *np = netdev_priv(netdev); struct ice_vsi *vsi = np->vsi; + if (ice_is_reset_in_progress(vsi->back->state)) + return -EBUSY; + if (q_num < 0) q_num = 0;