lkml.org 
[lkml]   [2009]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateTue, 28 Jul 2009 18:52:42 +0100
FromPaulo Marques <>
SubjectRe: [PATCH 6/12] drivers/platform/x86: Correct redundant test
Julia Lawall wrote:
> [...]
> ---
> drivers/platform/x86/fujitsu-laptop.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 218b9a1..5306901 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -745,9 +745,6 @@ static int acpi_fujitsu_remove(struct acpi_device *device, int type)
>
> fujitsu = acpi_driver_data(device);
>
> - if (!device || !acpi_driver_data(device))
> - return -EINVAL;
> -

Shouldn't this still do a:

if (!fujitsu)
return -EINVAL;
to avoid dereferencing a NULL pointer below?

> fujitsu->acpi_handle = NULL;
>
> return 0;

--
Paulo Marques - www.grupopie.com

"All I ask is a chance to prove that money can't make me happy."


\
 
 \ /
  Last update: 2009-07-28 20:27    [from the cache]
©2003-2010