Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp710334pxv; Thu, 15 Jul 2021 14:07:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLrAMGUK6EqwBoLa+twYTlIV41/LK0JaPd6fo9lvk+YUjp5NrF7HkX+I1fxDSgOBajrIZ2 X-Received: by 2002:a05:6402:1a25:: with SMTP id be5mr9863230edb.123.1626383260613; Thu, 15 Jul 2021 14:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383260; cv=none; d=google.com; s=arc-20160816; b=oWUnLBmHwLSb1cijRGEhCwyWVlLcpxg3XTiYyEb7Se5/aOqQzDxyQ0w2q0smjkZ9xV 1nJAbI3oeHhcPalBqPQeKYAWuPofjvrU9sARqIQpTnt/ozfqF4y9Tix2uFNcxFRPOhQ9 S3OcfBLh9F2bsu+Q/55UE74HLAAWPWE98flbDXbIDuYi0NTvY8DK1JtRbMjOi1SUvE4t YIE+b5uE46ep4c/19VtgC4aeAdrXMPtzRWeKW/3bArFh/o4kyzF5+AxOJFchz66wClsM T9Ng+8GrkmDp0NZzFhos3nNqPAvuq2ilaxaEwM9kE7P0+wBYdNzOqRwk43fhpLEE6pZD 15iQ== 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=fBdRGIwEpOO3ZQX6I/ae2LQ1+GgoMIHV+HhkUk2tvlM=; b=CLmizyJ6HbXC7m5zJGIoLVMCvzTMBMo6ZeB7w6/Ag8JV4Cd98wZ16S5Ht14PVs5+RD qRQfEi/nTw+ms4ombOFpHrK8MA/TleszW88qKBSZvujI8bar1S9UpjGIk1f5tBJLjc6g WtjYyO/qEXRlDkVOb+2/4JejXN0AcCCvzgffKXNQekxkBYLvKo4tWzydg2FJD+yRV0EA TNshuzp9oWf+q+0IDwGWJjMwVamXq8pt9l/MzkF5bzBqJU4WdB+sDR8MB2ABECLkQYap 8LAN7OMtrjn7oBLOAs4OAY/xIIhBVRBeGZwvMkmtKyVSVhmQNJ00KcOscXt2d1GQBo6T w/TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KbbTNAQp; 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 dg25si8357242edb.28.2021.07.15.14.07.18; Thu, 15 Jul 2021 14:07:40 -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=KbbTNAQp; 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 S242863AbhGOTRN (ORCPT + 99 others); Thu, 15 Jul 2021 15:17:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:39500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243053AbhGOTER (ORCPT ); Thu, 15 Jul 2021 15:04:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 795C7613F8; Thu, 15 Jul 2021 18:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375584; bh=wKQaD3i8J5jYXUh1Yy/Y0cldgAZqqXbZWRzqs1T2oP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KbbTNAQphNl9j7isSNvSNzS+n4on3699FMwWthsXFxahwuVQgWRsb2h5XDQVOlNYs COGiXRpFF1w9iXuCUgIyK2wE/PYXTGfTgTprGnskSIO9/GtccpOVg2edlJ8RJ2f0oR DO9li8TwlgPKjwzg6EBISDPBNZHtG5DETJK6vef4= 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.12 148/242] flow_offload: action should not be NULL when it is referenced Date: Thu, 15 Jul 2021 20:38:30 +0200 Message-Id: <20210715182619.259215787@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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 e6bd8ebf9ac3..c28ea1f0ec9c 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -313,12 +313,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