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] [day] [month] [year] [list]
Date:   Tue, 6 Jun 2017 08:38:59 +0200
From:   Corentin Labbe <clabbe.montjoie@...il.com>
To:     Jessica Yu <jeyu@...hat.com>
Cc:     rusty@...tcorp.com.au, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernel/module.c: fix warning about unused nowarn variable

On Mon, Jun 05, 2017 at 10:09:24PM -0700, Jessica Yu wrote:
> +++ Corentin Labbe [02/06/17 14:05 +0200]:
> >This patch fix the following warning:
> >kernel/module.c: In function 'add_usage_links':
> >kernel/module.c:1653:6: warning: variable 'nowarn' set but not used [-Wunused-but-set-variable]
> >  int nowarn;
> >
> >Signed-off-by: Corentin Labbe <clabbe.montjoie@...il.com>
> >---
> > kernel/module.c | 13 +++++++++----
> > 1 file changed, 9 insertions(+), 4 deletions(-)
> >
> >diff --git a/kernel/module.c b/kernel/module.c
> >index e3e9dbba6a5b..aed902bcb4aa 100644
> >--- a/kernel/module.c
> >+++ b/kernel/module.c
> >@@ -1663,19 +1663,20 @@ static inline void remove_notes_attrs(struct module *mod)
> > }
> > #endif /* CONFIG_KALLSYMS */
> >
> >-static void add_usage_links(struct module *mod)
> >+static int add_usage_links(struct module *mod)
> > {
> >+	int ret = 0;
> > #ifdef CONFIG_MODULE_UNLOAD
> > 	struct module_use *use;
> >-	int nowarn;
> >
> > 	mutex_lock(&module_mutex);
> > 	list_for_each_entry(use, &mod->target_list, target_list) {
> >-		nowarn = sysfs_create_link(use->target->holders_dir,
> >+		ret = sysfs_create_link(use->target->holders_dir,
> > 					   &mod->mkobj.kobj, mod->name);
> 
> ret will get overwritten with each iteration of the loop; we should return
> ret as soon as we hit an error (while making sure we unlock
> module_mutex).
> 

Thanks, I will fix all reported errors.
I just found also that in case of error, I need to "del_usage_links"

Regards

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ