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]
Date:	Thu, 11 Feb 2010 11:24:50 +0100
From:	Thomas Renninger <trenn@...e.de>
To:	Darren Jenkins <darrenrjenkins@...il.com>
Cc:	Len Brown <lenb@...nel.org>, Zhang Rui <rui.zhang@...el.com>,
	H Hartley Sweeten <hsweeten@...ionengravers.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux ACPI <linux-acpi@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Kernel Janitors <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] drivers/acpi/processor_thermal.c

Eh, 

what is this for?:
static inline void *acpi_driver_data(struct acpi_device *d)
{
        return d->driver_data;
}

On Thursday 11 February 2010 10:56:51 Darren Jenkins wrote:
> There are a few places where a pointer is dereferenced with acpi_driver_data()
> before a NULL test. This re-orders the code to fix these issues.
> 
> Coverity CID: 2752 2751 2750
> 
> Signed-off-by: Darren Jenkins <darrenrjenkins@...il.com>
> ---
>  drivers/acpi/processor_thermal.c |   28 ++++++++++++++++++++--------
>  1 files changed, 20 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
> index 6deafb4..ec33554 100644
> --- a/drivers/acpi/processor_thermal.c
> +++ b/drivers/acpi/processor_thermal.c
> @@ -379,9 +379,14 @@ processor_get_max_state(struct thermal_cooling_device *cdev,
>  			unsigned long *state)
>  {
>  	struct acpi_device *device = cdev->devdata;
> -	struct acpi_processor *pr = acpi_driver_data(device);
> +	struct acpi_processor *pr;
>  
> -	if (!device || !pr)
> +	if (!device)
> +		return -EINVAL;
> +
> +	pr = acpi_driver_data(device);
Better use (here and at other places):
device->driver_data
instead of
acpi_driver_data(device)

if you touch this anyway.
Then such bugs like the one you address here, don't happen
anymore in the future.
If you have some more time you might want to revert all the
other instances and revert the acpi_driver_data declaration
in include/acpi/acpi_bus.h

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