aboutsummaryrefslogtreecommitdiff
path: root/drivers/fpga/fpga-bridge.c
diff options
context:
space:
mode:
authorJohn Hubbard <[email protected]>2020-05-26 18:26:26 -0700
committerGreg Kroah-Hartman <[email protected]>2020-05-27 11:09:26 +0200
commit57343d51613227373759f5b0f2eede257fd4b82e (patch)
tree8870333e2f7387efec7a6b6d2a28badbdbe56897 /drivers/fpga/fpga-bridge.c
parent8d9eb0d6d59a5d7028c80a30831143d3e75515a7 (diff)
misc: xilinx-sdfec: improve get_user_pages_fast() error handling
This fixes the case of get_user_pages_fast() returning a -errno. The result needs to be stored in a signed integer. And for safe signed/unsigned comparisons, it's best to keep everything signed. And get_user_pages_fast() also expects a signed value for number of pages to pin. Therefore, change most relevant variables, from u32 to int. Leave "n" unsigned, for convenience in checking for overflow. And provide a WARN_ON_ONCE() and early return, if overflow occurs. Also, as long as we're tidying up: rename the page array from page, to pages, in order to match the conventions used in most other call sites. Fixes: 20ec628e8007e ("misc: xilinx_sdfec: Add ability to configure LDPC") Cc: Derek Kiernan <[email protected]> Cc: Dragan Cvetic <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Michal Simek <[email protected]> Cc: [email protected] Signed-off-by: John Hubbard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-bridge.c')
0 files changed, 0 insertions, 0 deletions