[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4C8F4C400200007800015EC7@vpn.id2.novell.com>
Date: Tue, 14 Sep 2010 09:19:44 +0100
From: "Jan Beulich" <JBeulich@...ell.com>
To: "Chen Gong" <gong.chen@...ux.intel.com>
Cc: <fenghua.yu@...el.com>, <lm-sensors@...sensors.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [lm-sensors] [PATCH] x86/hwmon: fix module init for
hotplug-but-no-device-found case
>>> On 14.09.10 at 09:46, Chen Gong <gong.chen@...ux.intel.com> wrote:
> 于 9/14/2010 2:47 PM, Jan Beulich 写道:
>>>>> On 14.09.10 at 08:30, Chen Gong<gong.chen@...ux.intel.com> wrote:
>>> 于 9/13/2010 6:05 PM, Jan Beulich 写道:
>>>> In commit 0dca94baeab4a1a514841b0a4c8e3a51dfb4d5ae the call to
>>>> platform_driver_unregister() was made conditional upon !HOTPLUG_CPU,
>>>> but the return value from coretemp_init() was left to indicate an
>>>> error. This isn't correct, as the negative return value indicates to
>>>> the module loader that initialization failed, which isn't intended
>>>
>>> only !HOTPLUG_CPU can remove the driver. That is what we need to do
>>> because under the hotplug condition, we need to consider those "offline"
>>> cpus. I don't understand what you are afraid. Can you give me a scinario ?
>>
>> If the driver's init routine returns -ENODEV (like is the case without this
>> change when HOTPLUG_CPU is enabled and there is no device found),
>> the platform driver will remain registered, yet the driver memory will
>> get freed (leaving dangling pointers into the driver's former image). Or
>
> Under this condition, I can't fine who frees the memory of the platform
> driver
I'm not talking about the control structure, but about the driver's
code and data.
>> in other words - when leaving the driver registered, the return value
>> of the init function must be zero.
>
> Is it mandotary or just some kind of convention ?
Mandatory.
Jan
--
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