| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 and |
|---|
| 6 | | - * only version 2 as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | | - * GNU General Public License for more details. |
|---|
| 12 | | - * |
|---|
| 13 | | - * You should have received a copy of the GNU General Public License |
|---|
| 14 | | - * along with this program; if not, write to the Free Software |
|---|
| 15 | | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|---|
| 16 | | - * 02110-1301, USA. |
|---|
| 17 | 4 | */ |
|---|
| 18 | 5 | |
|---|
| 19 | 6 | /* |
|---|
| .. | .. |
|---|
| 24 | 11 | */ |
|---|
| 25 | 12 | #include <linux/types.h> |
|---|
| 26 | 13 | #include <linux/uaccess.h> |
|---|
| 27 | | -#include <asm/pgtable.h> |
|---|
| 14 | +#include <linux/pgtable.h> |
|---|
| 28 | 15 | |
|---|
| 29 | 16 | /* |
|---|
| 30 | 17 | * For clear_user(), exploit previously defined copy_to_user function |
|---|
| .. | .. |
|---|
| 51 | 38 | |
|---|
| 52 | 39 | unsigned long clear_user_hexagon(void __user *dest, unsigned long count) |
|---|
| 53 | 40 | { |
|---|
| 54 | | - if (!access_ok(VERIFY_WRITE, dest, count)) |
|---|
| 41 | + if (!access_ok(dest, count)) |
|---|
| 55 | 42 | return count; |
|---|
| 56 | 43 | else |
|---|
| 57 | 44 | return __clear_user_hexagon(dest, count); |
|---|