forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/net/wireless/marvell/mwifiex/debugfs.c
....@@ -1,10 +1,10 @@
11 /*
2
- * Marvell Wireless LAN device driver: debugfs
2
+ * NXP Wireless LAN device driver: debugfs
33 *
4
- * Copyright (C) 2011-2014, Marvell International Ltd.
4
+ * Copyright 2011-2020 NXP
55 *
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
88 * (the "License"). You may use, redistribute and/or modify this File in
99 * accordance with the terms and conditions of the License, a copy of which
1010 * is available by writing to the Free Software Foundation, Inc.,
....@@ -265,8 +265,11 @@
265265 if (!p)
266266 return -ENOMEM;
267267
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
+
270273 phist_data = priv->hist_data;
271274
272275 p += sprintf(p, "\n"
....@@ -321,6 +324,8 @@
321324 ret = simple_read_from_buffer(ubuf, count, ppos, (char *)page,
322325 (unsigned long)p - page);
323326
327
+free_and_exit:
328
+ free_page(page);
324329 return ret;
325330 }
326331
....@@ -922,9 +927,8 @@
922927 }
923928
924929 #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); \
928932 } while (0);
929933
930934 #define MWIFIEX_DFS_FILE_OPS(name) \