Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2548670pxb; Mon, 19 Apr 2021 08:11:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXOXDuhoSwTnJwQv9E2fAJsv6hgp+zajyOUmlnXw3obGnzmd6oVR40UM+GF2I6HnZA7M46 X-Received: by 2002:a17:90a:6385:: with SMTP id f5mr25554054pjj.212.1618845114186; Mon, 19 Apr 2021 08:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618845114; cv=none; d=google.com; s=arc-20160816; b=tL1s6IX77TOmU/IuJJRmVhuXPF/IGtoWR97ZeVQTgf759R4e0MUYUNNPKKQ25qmpWw n4noLz3xmogh6219GqiLu6NqlbfveI/YhRNTa1I0kytrolhZVGjgtwHIRiuQbUH63B02 3XPpM2umF2nM5GRKsMNV5886GmAWsokhQZZGkjEmFi7tSBVteTMICMBzOvoxdu+irbsR P9uTrjX2Wp45xu+vE7Jr3cG09XN48bu/EsrGK9Yhh5DKgUEQJQ26gEujGUjIlMixb53p Y0XpFdXw1I6zqc9/6VO15UC+NdgF4Q6UsvWOMBEBMs5H753qSyeonx4ABNtTneLaWocn tMlQ== 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=MpE0ESZdCxA1B5jHsu+uqJUTyo/heYtmfI1wDmQfRkw=; b=0oyNRotKPEQG+jk7VvZplOj8lOYsx1XicW0ZvuVJQWoVODBbtNcAOseqaOrxVmBRE3 vgbbz6GsLkBSUknBBYxLTjmtxVHmhG6uqO/AL+33QuNK9Du9xIevfIhafwg8VgyhuPEg A04klMkubaP5PIkwd0huhJP2YEts0QYAa5LW4uTmhJwA3XKdif8de9rzuzyDie2Vp5rf 1vw2rcWKaJjW4A2shu9iR9go8qIwEQRkIvKmxp9apWGlD4MR3NSS+uZA5nJRnn/AKsg5 9se4bwVagtZpDwZ7sFlgqOECm2JjD+lnSCSMO7XIAlRhsbBdE1NJH052Bz+TlZ1w8hfy Oldg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PfeZ6com; 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 y16si17717460plh.187.2021.04.19.08.11.41; Mon, 19 Apr 2021 08:11:54 -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=PfeZ6com; 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 S240288AbhDSNNc (ORCPT + 99 others); Mon, 19 Apr 2021 09:13:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:47286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239855AbhDSNLZ (ORCPT ); Mon, 19 Apr 2021 09:11:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6EDA661370; Mon, 19 Apr 2021 13:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618837855; bh=xojuARV/qa1HClD2K8G1H1ETWj7RW1lKGmzJGcWugqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PfeZ6com2RYrDvTBp241/gwxRgjUe9cnpmm7Hvh/eXkMevN6D6n6u/ye47wkFe1oQ 3qwUOXmEEoXYeE3w3DzSXx9Ns/+F2wJnl9XGgbArVN+FYy+TuXTR8+nprT/QA/QBUR zTiUPHSX4h5PD6RRWiVF34eDal7sXkXQxWbJVBU0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , "David S. Miller" Subject: [PATCH 5.11 079/122] net: macb: fix the restore of cmp registers Date: Mon, 19 Apr 2021 15:05:59 +0200 Message-Id: <20210419130532.853558454@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130530.166331793@linuxfoundation.org> References: <20210419130530.166331793@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: Claudiu Beznea commit a714e27ea8bdee2b238748029d31472d0a65b611 upstream. Commit a14d273ba159 ("net: macb: restore cmp registers on resume path") introduces the restore of CMP registers on resume path. In case the IP doesn't support type 2 screeners (zero on DCFG8 register) the struct macb::rx_fs_list::list is not initialized and thus the list_for_each_entry(item, &bp->rx_fs_list.list, list) loop introduced in commit a14d273ba159 ("net: macb: restore cmp registers on resume path") will access an uninitialized list leading to crash. Thus, initialize the struct macb::rx_fs_list::list without taking into account if the IP supports type 2 screeners or not. Fixes: a14d273ba159 ("net: macb: restore cmp registers on resume path") Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3914,6 +3914,7 @@ static int macb_init(struct platform_dev reg = gem_readl(bp, DCFG8); bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3), GEM_BFEXT(T2SCR, reg)); + INIT_LIST_HEAD(&bp->rx_fs_list.list); if (bp->max_tuples > 0) { /* also needs one ethtype match to check IPv4 */ if (GEM_BFEXT(SCR2ETH, reg) > 0) { @@ -3924,7 +3925,6 @@ static int macb_init(struct platform_dev /* Filtering is supported in hw but don't enable it in kernel now */ dev->hw_features |= NETIF_F_NTUPLE; /* init Rx flow definitions */ - INIT_LIST_HEAD(&bp->rx_fs_list.list); bp->rx_fs_list.count = 0; spin_lock_init(&bp->rx_fs_lock); } else