Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp713741pxv; Thu, 15 Jul 2021 14:13:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz02OBGcHrfqzY2x6eI7lBQvHRUX7ELuAlhgxu9WzS/1oj+JTl0eUO5yQXrnovzK6IKp2o4 X-Received: by 2002:a05:6402:1bc6:: with SMTP id ch6mr9962821edb.267.1626383581892; Thu, 15 Jul 2021 14:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383581; cv=none; d=google.com; s=arc-20160816; b=MCz5841Lq0hUGPaySP1HjFRtj6JZy8yGq80TE9a4PKbIu1TEh2DAZWICDV5JY7Pds3 TzDL7K6eZUbX39PH1Xmp2suHrg47GO0Zvnim1UZoHT267JKNrByKd01P7p+zOtRUkZdm XJaS4bOklsR/fMlAEHDWdp9Zg6ZK50mXsDqZYwiXjTjBj61tyT8ANSkI5IEMZve/ir7v tzRUkXEsSbNpkpF3/3gNw7swfw3CsZZQmCcrn8PTtNBv9VObrcmD/8C3k0BKOvkreGc1 bqglAicmirDfNevErj2RsH0dfdEf9W4tE4XP3J7Nb11rCdjdIgdqWJhteaGECN9AX5D6 cxTA== 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=fuPDvtw08Ercufr1XUjmjkOer+F2kJiwsoLW30Qom0g=; b=T27NWKTz6MkSDtfkrnEqhJkvVamjds6OhIWwvJTkyn7mJm0AD0k5guxMHRVikUmgi/ 7poUb+tZNLZqjGmmx63RCrgod+IahkLeCb4vyyT923C7fUR5rMnQwGUFYaEOwlL25Eoc HXtykrA/tHzXBqMcwljO8a+Me6yV9ZYG9VILtpmx/EipbKEFe2NfdG1gugtB3Z+uj3lI aIHtYJz812NwmTFILUQriAw2K8aLgsTToFEvWQOLqPZo2nww8ciLdGBTEoZQzBcZvjCF lSj5H7ZJTIa31sqyLgXnTQ8lSI9Gx2LAvaAui9RM4SvXzL/q6JjA8ISoDBEdaSEhXSuF 03xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=igv0TmwM; 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 jp3si8252037ejb.706.2021.07.15.14.12.39; Thu, 15 Jul 2021 14:13:01 -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=igv0TmwM; 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 S245230AbhGOTjG (ORCPT + 99 others); Thu, 15 Jul 2021 15:39:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:51090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244286AbhGOTOk (ORCPT ); Thu, 15 Jul 2021 15:14:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3000C613DA; Thu, 15 Jul 2021 19:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376201; bh=+Lx/Ybu2Aq/kX7lL1Obv6xgjVcG9zJEyTOFHv8wmvHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=igv0TmwMCz5B7fX/vHm2LuMg60yivJqPnpAIJ+LEUlUCQ6bYLkgqHQOrhovSeKnnd z4IHVcptXAOe9LupmW5YIrVjL3jGgUPcdjTUsSzruwBadgzJLMtl9egyJpnuHQVvlh 6V7AUobEPQRdJQU0DdIOrdI2HahZp9nuBJrdjDeU= 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.13 171/266] flow_offload: action should not be NULL when it is referenced Date: Thu, 15 Jul 2021 20:38:46 +0200 Message-Id: <20210715182642.443757130@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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 dc5c1e69cd9f..69c9eabf8325 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -319,12 +319,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