Re: [PATCH v2 2/2] PCI: switchtec: Return -EFAULT for copy_to_user() errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2022-12-16 09:21, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>

Looks good to me thanks!

Reviewed-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>

Logan



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux