linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: Fix handling of pci user accessor return codes in syscalls
Date: Mon, 25 Jan 2021 13:57:00 -0600	[thread overview]
Message-ID: <20210125195700.GA2818097@bjorn-Precision-5520> (raw)
In-Reply-To: <f1220314-e518-1e18-bf94-8e6f8c703758@gmail.com>

On Sun, Jan 24, 2021 at 04:39:32PM +0100, Heiner Kallweit wrote:
> Referenced commit changed the user accessors to return negative errno's
> on error, seems this wasn't reflected in all users. Here it doesn't
> really make a difference because the effective check is the same.
> 
> Fixes: 34e3207205ef ("PCI: handle positive error codes")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied to pci/misc for v5.11, thanks!

> ---
>  drivers/pci/syscall.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
> index 31e39558d..8b003c890 100644
> --- a/drivers/pci/syscall.c
> +++ b/drivers/pci/syscall.c
> @@ -20,7 +20,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
>  	u16 word;
>  	u32 dword;
>  	long err;
> -	long cfg_ret;
> +	int cfg_ret;
>  
>  	if (!capable(CAP_SYS_ADMIN))
>  		return -EPERM;
> @@ -46,7 +46,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
>  	}
>  
>  	err = -EIO;
> -	if (cfg_ret != PCIBIOS_SUCCESSFUL)
> +	if (cfg_ret)
>  		goto error;
>  
>  	switch (len) {
> @@ -105,7 +105,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
>  		if (err)
>  			break;
>  		err = pci_user_write_config_byte(dev, off, byte);
> -		if (err != PCIBIOS_SUCCESSFUL)
> +		if (err)
>  			err = -EIO;
>  		break;
>  
> @@ -114,7 +114,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
>  		if (err)
>  			break;
>  		err = pci_user_write_config_word(dev, off, word);
> -		if (err != PCIBIOS_SUCCESSFUL)
> +		if (err)
>  			err = -EIO;
>  		break;
>  
> @@ -123,7 +123,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
>  		if (err)
>  			break;
>  		err = pci_user_write_config_dword(dev, off, dword);
> -		if (err != PCIBIOS_SUCCESSFUL)
> +		if (err)
>  			err = -EIO;
>  		break;
>  
> -- 
> 2.30.0
> 

      reply	other threads:[~2021-01-25 20:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 15:39 [PATCH] PCI: Fix handling of pci user accessor return codes in syscalls Heiner Kallweit
2021-01-25 19:57 ` Bjorn Helgaas [this message]

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=20210125195700.GA2818097@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).