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]
Date:	Mon, 12 May 2008 15:27:43 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Abdel Benamrouche <draconux@...il.com>
Cc:	aeb@....nl, linux-kernel@...r.kernel.org, trivial@...nel.org,
	draconux@...il.com
Subject: Re: [PATCH] /fs/partition/check.c: fix return value warning

On Sat, 10 May 2008 13:40:53 +0200
Abdel Benamrouche <draconux@...il.com> wrote:

> fs/partitions/check.c:381: warning: ignoring return value of ___device_add___,
>  declared with attribute warn_unused_result
> 
> Signed-off-by: Abdel Benamrouche <draconux@...il.com>
> ---
> :100644 100644 6149e4b... 7a87fad... M	fs/partitions/check.c
>  fs/partitions/check.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/partitions/check.c b/fs/partitions/check.c
> index 6149e4b..7a87fad 100644
> --- a/fs/partitions/check.c
> +++ b/fs/partitions/check.c
> @@ -378,7 +378,13 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len,
>  
>  	/* delay uevent until 'holders' subdir is created */
>  	p->dev.uevent_suppress = 1;
> -	device_add(&p->dev);
> +	if (device_add(&p->dev)) {
> +		put_device(&p->dev);
> +		free_part_stats(p);
> +		kfree(p);
> +		return;
> +	}
> +
>  	partition_sysfs_add_subdir(p);
>  	p->dev.uevent_suppress = 0;
>  	if (flags & ADDPART_FLAG_WHOLEDISK)

We should go further than this.  add_partition() just drops the error
on the floor.  It should be propagated back to callers, and callers
should be modified to handle it appropriately.

Presumably we should also handle a device_create_file() failure as well
- that is presently being silently ignored.

--
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