| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2014 Google, Inc. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This software is licensed under the terms of the GNU General Public |
|---|
| 5 | | - * License version 2, as published by the Free Software Foundation, and |
|---|
| 6 | | - * may be copied, distributed, and modified under those terms. |
|---|
| 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 | 4 | */ |
|---|
| 13 | 5 | |
|---|
| 14 | 6 | #include <linux/cdev.h> |
|---|
| .. | .. |
|---|
| 33 | 25 | record.size = count; |
|---|
| 34 | 26 | |
|---|
| 35 | 27 | /* check outside lock, page in any data. write_user also checks */ |
|---|
| 36 | | - if (!access_ok(VERIFY_READ, buf, count)) |
|---|
| 28 | + if (!access_ok(buf, count)) |
|---|
| 37 | 29 | return -EFAULT; |
|---|
| 38 | 30 | |
|---|
| 39 | 31 | mutex_lock(&pmsg_lock); |
|---|