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>] [day] [month] [year] [list]
Date:	Tue, 08 May 2007 19:10:56 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	Monakhov Dmitriy <dmonakhov@...nvz.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: floppy: handle device_create_file() failure while init

Linux Kernel Mailing List wrote:
> Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4ea1b0f4c4f656e0838a937c47be9544ed1c5118
> Commit:     4ea1b0f4c4f656e0838a937c47be9544ed1c5118
> Parent:     6de2d20235a2b8c751d39ec4b68347d66b19d815
> Author:     Dmitriy Monakhov <dmonakhov@...ru>
> AuthorDate: Tue May 8 00:25:58 2007 -0700
> Committer:  Linus Torvalds <torvalds@...dy.linux-foundation.org>
> CommitDate: Tue May 8 11:15:02 2007 -0700
> 
>     floppy: handle device_create_file() failure while init
>     
>     This patch kills the "ignoring return value of 'device_create_file'"
>     warning message.
>     
>     Signed-off-by: Monakhov Dmitriy <dmonakhov@...nvz.org>
>     Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
>     Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
> ---
>  drivers/block/floppy.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> index 5231ed7..3587cb4 100644
> --- a/drivers/block/floppy.c
> +++ b/drivers/block/floppy.c
> @@ -4334,7 +4334,10 @@ static int __init floppy_init(void)
>  		if (err)
>  			goto out_flush_work;
>  
> -		device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
> +		err = device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
> +		if (err)
> +			goto out_unreg_platform_dev;
> +
>  		/* to be cleaned up... */
>  		disks[drive]->private_data = (void *)(long)drive;
>  		disks[drive]->queue = floppy_queue;
> @@ -4345,6 +4348,8 @@ static int __init floppy_init(void)
>  
>  	return 0;
>  
> +out_unreg_platform_dev:
> +	platform_device_unregister(&floppy_device[drive]);
>  out_flush_work:
>  	flush_scheduled_work();
>  	if (usage_count)


This patch appears to leave things in a half-initialized state, upon error.

That's the big reason why I did not bother with this warning, it's not 
the low-hanging fruit it appears to be.

	Jeff


-
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