Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp481665ybl; Tue, 28 Jan 2020 06:38:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyJuUd+F85RlCy+elMb6XUDYSLtb+EcujtWhZA/6l2MCF8QB8LeWlAjyDkxBQvYB6broYBo X-Received: by 2002:aca:190b:: with SMTP id l11mr3081479oii.65.1580222288796; Tue, 28 Jan 2020 06:38:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222288; cv=none; d=google.com; s=arc-20160816; b=Z7IzpdznsFbQc6x2uslhTxfLotFPzuMcRIwL0kepSvq8X88sCWhWXghNbPyG1JBFd9 LbwOIG6fExMatpYuCR5pMSkpcstUzfi1c6adYbPobym1dE0f3vCh3HD87ymK7iveOIEN Kkf6U0usbLF3VbcprmR4viPBUtevW7/+6bGehUDwVW1vTOz0VXvkBFE4i0uNg7WSKSFm umB6c83qe+CtgB8DrL5JuSBPA22/+lcu89GzsgpalIQstuGK76g5m7L3TygiB+zLXnB1 qskZeij0TjctUUaOTF6hnapiPJf7iQq+2zzsdqvs+pc5eIYNlLS1ffnSvHGN97GM0jy9 ulIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gI2oM4yXLmt7QOgBwbg0VsmgakWF5CNslswujlTb0+M=; b=tI1vJkMDijtShodpqcGiX6tp4Hv/MMuxIjWljS6fcTfy4cKMsh0XxePmkenPoXwCXn u5ZoMB63EcF02RPCYAlhEFl/6545Aq2wgIKSPrNrjsDBPLQu3VKgucB7QiDnbVnzaJhr VAY/t7TE9rJE0N5JH9shqgWH9bgJtaTl3RpvsW0aXaQW0vV5J7z1RXQE9JiZBVI0oZhk sN32o6gKvTXDUT0J6r02t37qynGtyv9aC1ADQs3lIn3jk9T/ZBBwtXapXnmuL8wZvuqD OACJqyE+5E70gRmFQDpJh45xZzJKuH8XQIXL8fGNTIeXTF+oEgn9e16Pm5h4MwMHZDI3 DdtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oaRYo8V+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si5129397otj.242.2020.01.28.06.37.57; Tue, 28 Jan 2020 06:38:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oaRYo8V+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732134AbgA1OXZ (ORCPT + 99 others); Tue, 28 Jan 2020 09:23:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:49430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731512AbgA1OXV (ORCPT ); Tue, 28 Jan 2020 09:23:21 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 58CD12071E; Tue, 28 Jan 2020 14:23:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221400; bh=/188A5AV3dmrQIx72hiPDcmOUbywvXgwVDruUKUM3fk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oaRYo8V+9jxc3zx+y4rS1Sfa45JpK+O+wSUhdrJjpzvBKtjMebqrIlcdfddmy6Ia5 8WI8whnVGVKPS9oPRQ+/ZSFK+M+OnRinDguZ+XqmMYdOVn8qkoQIng3+5js7d0HfE4 OzZN9HB+pSjtjvX5Tx/EMZC7yoNCw1TT4U9g+mPs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jose Abreu , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 209/271] net: stmmac: gmac4+: Not all Unicast addresses may be available Date: Tue, 28 Jan 2020 15:05:58 +0100 Message-Id: <20200128135908.100101957@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jose Abreu [ Upstream commit 25683bab09a70542b9f8e3e28f79b3369e56701f ] Some setups may not have all Unicast addresses filters available. Check the number of available filters before trying to setup it. Fixes: 477286b53f55 ("stmmac: add GMAC4 core support") Signed-off-by: Jose Abreu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index f46f2bfc2cc09..4216c0a5eaf5a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -168,7 +168,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw, } /* Handle multiple unicast addresses */ - if (netdev_uc_count(dev) > GMAC_MAX_PERFECT_ADDRESSES) { + if (netdev_uc_count(dev) > hw->unicast_filter_entries) { /* Switch to promiscuous mode if more than 128 addrs * are required */ -- 2.20.1