lkml.org 
[lkml]   [2017]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] netfilter: nat: Do not use ARRAY_SIZE() on spinlocks to fix zero div
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.

\
 
 \ /
  Last update: 2017-09-18 17:35    [W:0.036 / U:8.548 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site