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]
Message-ID: <AANLkTimpkmAoPep9s1Hp5gZvdjzDm_1iBO32xYeAQL5F@mail.gmail.com>
Date:	Tue, 6 Jul 2010 16:07:49 +0800
From:	Axel Lin <axel.lin@...il.com>
To:	Thomas Renninger <trenn@...e.de>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Matthew Garrett <mjg@...hat.com>,
	Len Brown <len.brown@...el.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frans Pop <elendil@...net.nl>,
	Anisse Astier <anisse@...ier.eu>,
	platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH] hp-wmi: add return value checking for 
	input_allocate_device()

hi Thomas,
2010/7/6 Thomas Renninger <trenn@...e.de>:
> Hi,
>
> it's incredible how much cleanups and fixes you find in this
> handful of drivers... It's very much appreciated!
>
> On Tuesday 06 July 2010 04:30:26 Axel Lin wrote:
>> Add error checking and return -ENOMEM if input_allocate_device() fail.
>>
>> Signed-off-by: Axel Lin <axel.lin@...il.com>
>> ---
>>  drivers/platform/x86/hp-wmi.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
>> index 51c07a0..c508e20 100644
>> --- a/drivers/platform/x86/hp-wmi.c
>> +++ b/drivers/platform/x86/hp-wmi.c
>> @@ -402,6 +402,8 @@ static int __init hp_wmi_input_setup(void)
>>       int err;
>>
>>       hp_wmi_input_dev = input_allocate_device();
>> +     if (!hp_wmi_input_dev)
>> +             return -ENOMEM;
>>
>>       hp_wmi_input_dev->name = "HP WMI hotkeys";
>>       hp_wmi_input_dev->phys = "wmi/input0";
> But also hp_wmi_input_setup() call should get checked and if it
> fails, the previous wmi_install_notify_handler() must get uninstalled
> again. Hm, probably the whole driver shouldn't load then and
> the error code from hp_wmi_input_setup() can be returned in
> hp_wmi_init(void).
>
> Do you mind to incorporate above if you agree.

Checking hp_wmi_input_setup() is already done in my previous patch.
( which is already merged in platform-driver-x86 tree.
http://git.kernel.org/?p=linux/kernel/git/mjg59/platform-drivers-x86.git;a=commitdiff;h=b035d5f9fcb6cd6bba44b764b17d885f4d960d37
).
Thus this patch only adds the return value checking for
input_allocate_device() in hp_wmi_input_setup().

Regards,
Axel


>
> Thanks,
>
>   Thomas
>
--
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