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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87eglsuujn.fsf@rustcorp.com.au>
Date:	Thu, 04 Jun 2015 11:03:16 +0930
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Tejun Heo <htejun@...il.com>,
	Louis Langholtz <lou_langholtz@...com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: kernel/params.c: 'err' variable "set but not used" and perhaps should be?

Tejun Heo <htejun@...il.com> writes:
>> > @@ -853,7 +853,8 @@ static void __init version_sysfs_builtin(void)
>> >                mk = locate_module_kobject(vattr->module_name);
>> >                if (mk) {
>> > -                       err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr);
>> > +                       if (sysfs_create_file(&mk->kobj, &vattr->mattr.attr))
>> > +                               doesnt_happen();
>> >                        kobject_uevent(&mk->kobj, KOBJ_ADD);
>> >                        kobject_put(&mk->kobj);
>> >                }
>> 
>> Arguably then, the BUG_ON macro seems more appropriate for this situation
>> than this suggested doesnt_happen macro or my original offering of a call to
>> pr_warning.
>
> It does happen.  If you don't wanna roll back on failure, just wrap it
> in WARN_ON() so that there's at least some indication that something
> failed there?  It'd kinda suck to be missing some interface files w/o
> any indication, wouldn't it?

Please describe the circumstances under which this function can fail.

Thanks,
Rusty.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ