Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp630787pxv; Thu, 15 Jul 2021 12:00:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybAREJBTTm1v/x/zyWT7hnLjseebrMN20QOMkckuxet1ca1oLAyj0+cFLjNA08D5DmvDSU X-Received: by 2002:aa7:ca04:: with SMTP id y4mr8872799eds.83.1626375602811; Thu, 15 Jul 2021 12:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375602; cv=none; d=google.com; s=arc-20160816; b=yrRD/6Xf3RndgyFxlCUF3T4qIMU0I188dtuxiBy9ckB44RKV5doS5heR/6YK1fhsC3 ejQR3Po7SC/mOiV8Okr4MAlnIXeFZ3ZcaCKBqYaRjvzf84MZykHATV2ZEnAT8i8kIWbU gzx0nQyhToLVCTyBfIgiYarWVnrhiWjog69cc7G676w7CyK/rco++x52BV6cMq/xX/rR XosEDhpK+iS+/OCPtmcSvVbLM5z3ZsshmKP5cvxD9XB9R+e2i3WLjDfsWUWqmqY2mAh1 MFDvAwd9dyVrqFZzjj5wx5jM2S3SdI+U7ymKLkZPs/Jfv0o2T+M6tTwpYQvJyRD2p9Yg +JWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zKothN0mTNZQR7bv0BowpSp0SaWia7JHZ0e/yGC7o00=; b=euELCofC/6nuzbOoDx21fpnt4co+C8NYWSlOWG20G/M9eHCevJjveGlUBGl5bQuaer +taahO4RqqAejYGYiRtKYyBDemRG2LfiNxKHAuRf4RaUl1QVpUEpczrdaQCqzWZRhVct QkfBKj3ec3QDJkmdX0c36wVKCAJZeny+xwWuzy3SshwMFhUW/4Zkcg6IHt1zBtGmURXv sWM9BxIC3wLdp8dweJoGnaXQ/hmY8mjc2jzwgLt/g6GnlV2p5LishEgLK+vyoEMXsQiD 6PHXKkCu1XnlaXRfc+8k5t8IjqLrKUyHe+ANfBd8GazLDSIpO2oVazSfrYR2PFjiSLNb JEeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZGhNGXdg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qa18si8043675ejc.491.2021.07.15.11.59.37; Thu, 15 Jul 2021 12:00:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZGhNGXdg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243153AbhGOTAO (ORCPT + 99 others); Thu, 15 Jul 2021 15:00:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239723AbhGOSxV (ORCPT ); Thu, 15 Jul 2021 14:53:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD5BD613D9; Thu, 15 Jul 2021 18:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375027; bh=39gpyIivHJFOU7uLtvdFVi/kaUVGioQxAgNGDj3CG5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZGhNGXdgczbHn51vqgXOagLwD9UcNZOABg8BaF5bT/Ejh2yOHsrIxT53c8c/Q3i5F /XJEk02YnzdUzlPyCqSJ5qTPko9dDvkhMrtNTJktUAi9tUQKv2JKADYLZXSKhcFDdX z+R9Fwx0RPBWwPJgKCuCz0WeBXymoLaCui4gQvl0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, gushengxian <13145886936@163.com>, gushengxian , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 128/215] flow_offload: action should not be NULL when it is referenced Date: Thu, 15 Jul 2021 20:38:20 +0200 Message-Id: <20210715182622.098145970@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@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: X-Mailing-List: linux-kernel@vger.kernel.org From: gushengxian [ Upstream commit 9ea3e52c5bc8bb4a084938dc1e3160643438927a ] "action" should not be NULL when it is referenced. Signed-off-by: gushengxian <13145886936@163.com> Signed-off-by: gushengxian Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/net/flow_offload.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 123b1e9ea304..161b90979038 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -312,12 +312,14 @@ flow_action_mixed_hw_stats_check(const struct flow_action *action, if (flow_offload_has_one_action(action)) return true; - flow_action_for_each(i, action_entry, action) { - if (i && action_entry->hw_stats != last_hw_stats) { - NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported"); - return false; + if (action) { + flow_action_for_each(i, action_entry, action) { + if (i && action_entry->hw_stats != last_hw_stats) { + NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported"); + return false; + } + last_hw_stats = action_entry->hw_stats; } - last_hw_stats = action_entry->hw_stats; } return true; } -- 2.30.2