diff options
| author | Souptick Joarder <[email protected]> | 2020-09-20 08:21:35 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2020-09-22 18:53:47 +0200 |
| commit | a81072a9c0ae734b7889929b0bc070fe3f353f0e (patch) | |
| tree | 6b92cca0dc0919c5fe0cc0787867eeb98b5baa75 /tools/perf/scripts/python | |
| parent | a2e7408cf8fc7790a219a8b4a617fd2c91f8bf15 (diff) | |
misc: mic: scif: Fix error handling path
Inside __scif_pin_pages(), when map_flags != SCIF_MAP_KERNEL it
will call pin_user_pages_fast() to map nr_pages. However,
pin_user_pages_fast() might fail with a return value -ERRNO.
The return value is stored in pinned_pages->nr_pages. which in
turn is passed to unpin_user_pages(), which expects
pinned_pages->nr_pages >=0, else disaster.
Fix this by assigning pinned_pages->nr_pages to 0 if
pin_user_pages_fast() returns -ERRNO.
Fixes: ba612aa8b487 ("misc: mic: SCIF memory registration and unregistration")
Cc: John Hubbard <[email protected]>
Cc: Ira Weiny <[email protected]>
Cc: Dan Carpenter <[email protected]>
Reviewed-by: John Hubbard <[email protected]>
Signed-off-by: Souptick Joarder <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions