From: Logan Gunthorpe <logang@deltatee.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
Kurt Schwemmer <kurt.schwemmer@microsemi.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH v2 2/2] PCI: switchtec: Return -EFAULT for copy_to_user() errors
Date: Fri, 16 Dec 2022 09:33:19 -0700 [thread overview]
Message-ID: <9fdae348-3416-6227-e059-5cd70369e4be@deltatee.com> (raw)
In-Reply-To: <20221216162126.207863-3-helgaas@kernel.org>
On 2022-12-16 09:21, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> switchtec_dev_read() didn't handle copy_to_user() errors correctly: it
> assigned "rc = -EFAULT", but actually returned either "size", -ENXIO, or
> -EBADMSG instead.
>
> Update the failure cases to unlock mrpc_mutex and return -EFAULT directly.
>
> Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver")
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Looks good to me thanks!
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Logan
next prev parent reply other threads:[~2022-12-16 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 16:21 [PATCH v2 0/2] PCI: switchtec: Trivial cleanups Bjorn Helgaas
2022-12-16 16:21 ` [PATCH v2 1/2] PCI: switchtec: Simplify switchtec_dma_mrpc_isr() Bjorn Helgaas
2022-12-16 16:21 ` [PATCH v2 2/2] PCI: switchtec: Return -EFAULT for copy_to_user() errors Bjorn Helgaas
2022-12-16 16:33 ` Logan Gunthorpe [this message]
2022-12-16 18:13 ` kernel test robot
2022-12-16 19:24 ` kernel test robot
2022-12-30 11:22 ` [PATCH v2 0/2] PCI: switchtec: Trivial cleanups Lorenzo Pieralisi
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=9fdae348-3416-6227-e059-5cd70369e4be@deltatee.com \
--to=logang@deltatee.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=kurt.schwemmer@microsemi.com \
--cc=linux-kernel@vger.kernel.org \
--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