mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
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.
Link: https://lore.kernel.org/r/[email protected]
Fixes: 080b47def5 ("MicroSemi Switchtec management interface driver")
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>