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] [day] [month] [year] [list]
Date:   Wed, 20 Jul 2022 15:44:26 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Andrey Strachuk <strochuk@...ras.ru>
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>, linux-pci@...r.kernel.org,
        linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        ldv-project@...uxtesting.org
Subject: Re: [PATCH v2] ACPI/PCI: Remove useless NULL pointer checks

On Wed, Jul 20, 2022 at 12:47:43PM +0300, Andrey Strachuk wrote:
> Local variable 'p' is initialized by an address
> of field of acpi_resource, so it does not make
> sense to compare 'p' with NULL.

Rewrap to fill 75 columns, which is the typical width of commit logs.

> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Andrey Strachuk <strochuk@...ras.ru>
> ---
>  drivers/acpi/pci_link.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
> index 58647051c948..aa1038b8aec4 100644
> --- a/drivers/acpi/pci_link.c
> +++ b/drivers/acpi/pci_link.c
> @@ -95,7 +95,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
>  	case ACPI_RESOURCE_TYPE_IRQ:
>  		{
>  			struct acpi_resource_irq *p = &resource->data.irq;
> -			if (!p || !p->interrupt_count) {
> +			if (!p->interrupt_count) {
>  				acpi_handle_debug(handle,
>  						  "Blank _PRS IRQ resource\n");
>  				return AE_OK;
> @@ -121,7 +121,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
>  		{
>  			struct acpi_resource_extended_irq *p =
>  			    &resource->data.extended_irq;
> -			if (!p || !p->interrupt_count) {
> +			if (!p->interrupt_count) {
>  				acpi_handle_debug(handle,
>  						  "Blank _PRS EXT IRQ resource\n");
>  				return AE_OK;
> @@ -182,7 +182,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
>  	case ACPI_RESOURCE_TYPE_IRQ:
>  		{
>  			struct acpi_resource_irq *p = &resource->data.irq;
> -			if (!p || !p->interrupt_count) {
> +			if (!p->interrupt_count) {
>  				/*
>  				 * IRQ descriptors may have no IRQ# bits set,
>  				 * particularly those w/ _STA disabled
> @@ -197,7 +197,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
>  		{
>  			struct acpi_resource_extended_irq *p =
>  			    &resource->data.extended_irq;
> -			if (!p || !p->interrupt_count) {
> +			if (!p->interrupt_count) {
>  				/*
>  				 * extended IRQ descriptors must
>  				 * return at least 1 IRQ
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ