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:	Mon, 25 Sep 2006 13:18:27 +0200 (MEST)
From:	Mikael Pettersson <mikpe@...uu.se>
To:	amol@...ismonetworks.com, kernel-janitors@...ts.osdl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] misc_register error return handling

On Mon, 25 Sep 2006 14:29:00 +0530, Amol Lad wrote:
> diff -uprN -X linux-2.6.18-orig/Documentation/dontdiff linux-2.6.18-orig/arch/i386/kernel/apm.c linux-2.6.18/arch/i386/kernel/apm.c
> --- linux-2.6.18-orig/arch/i386/kernel/apm.c	2006-09-21 10:15:25.000000000 +0530
> +++ linux-2.6.18/arch/i386/kernel/apm.c	2006-09-25 13:59:53.000000000 +0530
> @@ -2246,6 +2246,12 @@ static int __init apm_init(void)
>  		return -ENODEV;
>  	}
>  
> +	ret = misc_register(&apm_device);
> +	if (ret != 0) {
> +		printk(KERN_ERR "apm: cannot register misc device.\n");
> +		return ret;
> +	}
> +
>  	if (allow_ints)
>  		apm_info.allow_ints = 1;
>  	if (broken_psr)
> @@ -2282,17 +2288,20 @@ static int __init apm_init(void)
>  
>  	if (apm_info.disabled) {
>  		printk(KERN_NOTICE "apm: disabled on user request.\n");
> -		return -ENODEV;
> +		ret = -ENODEV;
> +		goto out_misc;

etc

NAK on the APM changes. APM can do its work just fine even if
it failed to register a device file; it will just lack some
user interface/control bits.

> @@ -2348,8 +2358,6 @@ static int __init apm_init(void)
>  		return 0;
>  	}
>  
> -	misc_register(&apm_device);
> -

This should just print a warning (but not fail) if misc_register()
returned failure.

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