lkml.org 
[lkml]   [2022]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] PCI: switchtec: Return -EFAULT for copy_to_user() errors


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

\
 
 \ /
  Last update: 2022-12-16 17:34    [W:0.134 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site