| .. | .. |
|---|
| 1 | 1 | /* |
|---|
| 2 | | - * Marvell Wireless LAN device driver: debugfs |
|---|
| 2 | + * NXP Wireless LAN device driver: debugfs |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * Copyright (C) 2011-2014, Marvell International Ltd. |
|---|
| 4 | + * Copyright 2011-2020 NXP |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * This software file (the "File") is distributed by Marvell International |
|---|
| 7 | | - * Ltd. under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 6 | + * This software file (the "File") is distributed by NXP |
|---|
| 7 | + * under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 8 | 8 | * (the "License"). You may use, redistribute and/or modify this File in |
|---|
| 9 | 9 | * accordance with the terms and conditions of the License, a copy of which |
|---|
| 10 | 10 | * is available by writing to the Free Software Foundation, Inc., |
|---|
| .. | .. |
|---|
| 265 | 265 | if (!p) |
|---|
| 266 | 266 | return -ENOMEM; |
|---|
| 267 | 267 | |
|---|
| 268 | | - if (!priv || !priv->hist_data) |
|---|
| 269 | | - return -EFAULT; |
|---|
| 268 | + if (!priv || !priv->hist_data) { |
|---|
| 269 | + ret = -EFAULT; |
|---|
| 270 | + goto free_and_exit; |
|---|
| 271 | + } |
|---|
| 272 | + |
|---|
| 270 | 273 | phist_data = priv->hist_data; |
|---|
| 271 | 274 | |
|---|
| 272 | 275 | p += sprintf(p, "\n" |
|---|
| .. | .. |
|---|
| 321 | 324 | ret = simple_read_from_buffer(ubuf, count, ppos, (char *)page, |
|---|
| 322 | 325 | (unsigned long)p - page); |
|---|
| 323 | 326 | |
|---|
| 327 | +free_and_exit: |
|---|
| 328 | + free_page(page); |
|---|
| 324 | 329 | return ret; |
|---|
| 325 | 330 | } |
|---|
| 326 | 331 | |
|---|
| .. | .. |
|---|
| 922 | 927 | } |
|---|
| 923 | 928 | |
|---|
| 924 | 929 | #define MWIFIEX_DFS_ADD_FILE(name) do { \ |
|---|
| 925 | | - if (!debugfs_create_file(#name, 0644, priv->dfs_dev_dir, \ |
|---|
| 926 | | - priv, &mwifiex_dfs_##name##_fops)) \ |
|---|
| 927 | | - return; \ |
|---|
| 930 | + debugfs_create_file(#name, 0644, priv->dfs_dev_dir, priv, \ |
|---|
| 931 | + &mwifiex_dfs_##name##_fops); \ |
|---|
| 928 | 932 | } while (0); |
|---|
| 929 | 933 | |
|---|
| 930 | 934 | #define MWIFIEX_DFS_FILE_OPS(name) \ |
|---|