mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: William Breathitt Gray <william.gray@linaro.org>
To: Vladislav Efanov <VEfanov@ispras.ru>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Rene Herman <rene.herman@keyaccess.nl>,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] isa: Remove unnecessary checks
Date: Thu, 18 May 2023 21:46:21 -0400	[thread overview]
Message-ID: <ZGbU7YQgzGelwiGy@fedora> (raw)
In-Reply-To: <20230517125025.434005-1-VEfanov@ispras.ru>

[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]

On Wed, May 17, 2023 at 03:50:25PM +0300, Vladislav Efanov wrote:
> The isa_dev->dev.platform_data is initialized with incoming
> parameter isa_driver. After it isa_dev->dev.platform_data is
> checked for NULL, but incoming parameter isa_driver is not
> NULL since it is dereferenced many times before this check.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: a5117ba7da37 ("[PATCH] Driver model: add ISA bus")
> Signed-off-by: Vladislav Efanov <VEfanov@ispras.ru>

I don't think the Fixes line is needed because this is removing a
superfluous check rather than fixing a bug. Regardless, here's my Ack
for Greg as the patch itself makes sense.

Acked-by: William Breathitt Gray <william.gray@linaro.org>

> ---
>  drivers/base/isa.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/isa.c b/drivers/base/isa.c
> index 55e3ee2da98f..675ad3139224 100644
> --- a/drivers/base/isa.c
> +++ b/drivers/base/isa.c
> @@ -149,11 +149,8 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev)
>  			break;
>  		}
>  
> -		if (isa_dev->dev.platform_data) {
> -			isa_dev->next = isa_driver->devices;
> -			isa_driver->devices = &isa_dev->dev;
> -		} else
> -			device_unregister(&isa_dev->dev);
> +		isa_dev->next = isa_driver->devices;
> +		isa_driver->devices = &isa_dev->dev;
>  	}
>  
>  	if (!error && !isa_driver->devices)
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-05-19  1:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 12:50 Vladislav Efanov
2023-05-19  1:46 ` William Breathitt Gray [this message]
2023-05-31 18:03   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZGbU7YQgzGelwiGy@fedora \
    --to=william.gray@linaro.org \
    --cc=VEfanov@ispras.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=rafael@kernel.org \
    --cc=rene.herman@keyaccess.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®