Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933214AbcDYRxm (ORCPT ); Mon, 25 Apr 2016 13:53:42 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:33180 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933033AbcDYRxl convert rfc822-to-8bit (ORCPT ); Mon, 25 Apr 2016 13:53:41 -0400 MIME-Version: 1.0 In-Reply-To: <87vb35a942.fsf@ketchup.mtl.sfl> References: <1461570761-12187-1-git-send-email-geert@linux-m68k.org> <87r3dtybm8.fsf@ketchup.mtl.sfl> <87vb35a942.fsf@ketchup.mtl.sfl> Date: Mon, 25 Apr 2016 19:53:39 +0200 X-Google-Sender-Auth: GAlE_GAtsobrrdXErh9DNIMkv20 Message-ID: Subject: Re: [PATCH] [RFC] net: dsa: mv88e6xxx: Pre-initialize err in mv88e6xxx_port_bridge_join() From: Geert Uytterhoeven To: Vivien Didelot Cc: "David S. Miller" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1821 Lines: 49 Hi Vivien, On Mon, Apr 25, 2016 at 7:31 PM, Vivien Didelot wrote: > Geert Uytterhoeven writes: >> On Mon, Apr 25, 2016 at 5:03 PM, Vivien Didelot >> wrote: >>> Geert Uytterhoeven writes: >>>> drivers/net/dsa/mv88e6xxx.c: In function ‘mv88e6xxx_port_bridge_join’: >>>> drivers/net/dsa/mv88e6xxx.c:2184: warning: ‘err’ may be used uninitialized in this function >>> >>> Interesting, I don't have those warnings on 207afda1b5036009... >> >> It depends on the compiler version (still using 4.1.2) and options. >> >>>> If netdev_notifier_changeupper_info.upper_dev is ever NULL, the bridge >>>> parameter will be NULL too, and the function will return an >>>> uninitialized value. >>>> >>>> Pre-initialize err to zero to fix this. >>>> >>>> Fixes: 207afda1b5036009 ("net: dsa: mv88e6xxx: share the same default FDB") >>>> Signed-off-by: Geert Uytterhoeven >>>> --- >>>> Can this actually happen? >>> >>> bridge cannot be NULL here. Also ps->ports[port].bridge_dev is assigned >>> to it before entering the for loop, so _mv88e6xxx_port_based_vlan_map >>> will be called at least for this port. >> >> But there's no way the compiler can know that... > > Or maybe it can in new configurations. Anyway, this fix doesn't hurt, > with a relevant commit message, I'd ack it. What would you consider a relevant commit message? Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds