[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070416202421.GC19713@flint.arm.linux.org.uk>
Date: Mon, 16 Apr 2007 21:24:21 +0100
From: Russell King <rmk+lkml@....linux.org.uk>
To: Anton Vorontsov <cbou@...l.ru>
Cc: linux-kernel@...r.kernel.org, kernel-discuss@...dhelds.org
Subject: Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries
On Fri, Apr 13, 2007 at 05:50:43PM +0400, Anton Vorontsov wrote:
> +static void (*old_apm_get_power_status)(struct apm_power_info*);
> +
> +static int __init apm_battery_init(void)
> +{
> + printk(KERN_INFO "APM Battery Driver\n");
> +
> + old_apm_get_power_status = apm_get_power_status;
> + apm_get_power_status = apm_battery_apm_get_power_status;
> + return 0;
> +}
> +
> +static void __exit apm_battery_exit(void)
> +{
> + apm_get_power_status = old_apm_get_power_status;
> + return;
> +}
Utterly unsafe. What happens if some other module gets loaded which
does this, and then this module is unloaded followed by the other
module. Result: Oops.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
-
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