lkml.org 
[lkml]   [2022]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] PCI: switchtec: Remove useless assignments in switchtec_dev_read()


On 2022-12-15 11:21, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> Some switchtec_dev_read() error cases assign to "rc", then branch to "out".
> But the code at "out" never uses "rc". Drop the useless assignments. No
> functional change intended.

Ah, hmm, yes. I think if copy_to_user() fails, the function should
probably return -EFAULT. So perhaps an unlock and specific return as is
done in previous conditions in the same function?

Thanks,

Logan

\
 
 \ /
  Last update: 2022-12-15 19:37    [W:0.083 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site