lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 6 Sep 2010 17:12:18 -0700 From: Dmitry Torokhov <dmitry.torokhov@...il.com> To: "Nicholas A. Bellinger" <nab@...ux-iscsi.org> Cc: linux-scsi <linux-scsi@...r.kernel.org>, linux-kernel <linux-kernel@...r.kernel.org>, Douglas Gilbert <dgilbert@...erlog.com>, Richard Sharpe <realrichardsharpe@...il.com>, Christoph Hellwig <hch@....de>, FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>, Mike Christie <michaelc@...wisc.edu>, Hannes Reinecke <hare@...e.de>, James Bottomley <James.Bottomley@...e.de>, Greg KH <greg@...ah.com> Subject: Re: [PATCH] scsi_debug: Convert to use root_device_register() and root_device_unregister() On Mon, Sep 06, 2010 at 04:39:14PM -0700, Nicholas A. Bellinger wrote: > On Mon, 2010-09-06 at 16:41 -0700, Dmitry Torokhov wrote: > > On Mon, Sep 06, 2010 at 03:32:20PM -0700, Nicholas A. Bellinger wrote: > > > static int __init scsi_debug_init(void) > > > { > > > unsigned long sz; > > > int host_to_add; > > > int k; > > > - int ret; > > > + int ret = 0; > > > > > > > Please do not initialize error condition with success; when adding > > additional initialization it makes easy to miss assigning proper return > > value (as you seem to have) and return success in case of failure. > > The reason this was added because my gcc (Debian 4.3.2-1.1) 4.3.2 > complained about this being possibily uninitialized.. > And rightly so - you did not assign a value to it when handling root_device_register() failure. Compiler warnings are generally there for a reason, not just a nuisance that should be shut off without a second thought. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists