It's possible that get_user_pages() could fail. So evaluate its
return code and handle this error case properly.
This issue has been found by Cppcheck.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
prev_idx = -1;
page = NULL;
+ if (rc < 0) {
+ vchiq_log_error(vchiq_arm_log_level,
+ "Failed to get user pages: %d\n", rc);
+ goto out;
+ }
+
while (offset < end_offset) {
int page_offset = offset % PAGE_SIZE;
offset += 16;
}
+
+out:
if (page != NULL)
kunmap(page);