From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932783AbdIRPeM (ORCPT ); Mon, 18 Sep 2017 11:34:12 -0400 Received: from ganesha.gnumonks.org ([213.95.27.120]:35887 "EHLO ganesha.gnumonks.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753400AbdIRPeI (ORCPT ); Mon, 18 Sep 2017 11:34:08 -0400 Date: Mon, 18 Sep 2017 17:33:47 +0200 From: Pablo Neira Ayuso To: Geert Uytterhoeven Cc: Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , Arnd Bergmann , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: nat: Do not use ARRAY_SIZE() on spinlocks to fix zero div Message-ID: <20170918153347.GA28198@salvia> References: <1505043701-13255-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1505043701-13255-1-git-send-email-geert@linux-m68k.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 10, 2017 at 01:41:41PM +0200, Geert Uytterhoeven wrote: > If no spinlock debugging options (CONFIG_GENERIC_LOCKBREAK, > CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_LOCK_ALLOC) are enabled on a UP > platform (e.g. m68k defconfig), arch_spinlock_t is an empty struct, > hence using ARRAY_SIZE(nf_nat_locks) causes a division by zero: > > net/netfilter/nf_nat_core.c: In function ‘nf_nat_setup_info’: > net/netfilter/nf_nat_core.c:432: warning: division by zero > net/netfilter/nf_nat_core.c: In function ‘__nf_nat_cleanup_conntrack’: > net/netfilter/nf_nat_core.c:535: warning: division by zero > net/netfilter/nf_nat_core.c:537: warning: division by zero > net/netfilter/nf_nat_core.c: In function ‘nf_nat_init’: > net/netfilter/nf_nat_core.c:810: warning: division by zero > net/netfilter/nf_nat_core.c:811: warning: division by zero > net/netfilter/nf_nat_core.c:824: warning: division by zero > > Fix this by using the CONNTRACK_LOCKS definition instead. Applied.