mwlwifi: Update to version 10.3.4.0-20180226
[openwrt/openwrt.git] / package / kernel / mwlwifi / patches / 001-remove-vfs_write.patch
1 --- a/debugfs.c
2 +++ b/debugfs.c
3 @@ -279,7 +279,6 @@ static void core_dump_file(u8 *valbuf, u
4 u32 append, u32 totallen, bool textmode)
5 {
6 struct file *filp_core = NULL;
7 - mm_segment_t oldfs;
8 char file_name[40];
9 u8 *buf = kmalloc(length * 3, GFP_KERNEL);
10 u8 *data_p = buf;
11 @@ -292,9 +291,6 @@ static void core_dump_file(u8 *valbuf, u
12 sprintf(file_name, "/dev/shm/coredump-%x-%x",
13 region, (region + totallen));
14
15 - oldfs = get_fs();
16 - set_fs(KERNEL_DS);
17 -
18 if (append)
19 filp_core = filp_open(file_name, O_RDWR | O_APPEND, 0);
20 else
21 @@ -317,15 +313,15 @@ static void core_dump_file(u8 *valbuf, u
22 }
23 data_p = buf + j;
24 data_p += sprintf(data_p, "\n");
25 - vfs_write(filp_core, buf, strlen(buf),
26 - &filp_core->f_pos);
27 + kernel_write(filp_core, buf, strlen(buf),
28 + &filp_core->f_pos);
29 } else
30 - vfs_write(filp_core, valbuf, length, &filp_core->f_pos);
31 + kernel_write(filp_core, valbuf, length,
32 + &filp_core->f_pos);
33
34 filp_close(filp_core, current->files);
35 }
36
37 - set_fs(oldfs);
38 kfree(buf);
39 }
40
41 @@ -1339,7 +1335,6 @@ static ssize_t mwl_debugfs_ba_hist_read(
42 u8 bmap0flag, nobaflag;
43 char buff[500], file_location[20];
44 struct file *filp_bahisto;
45 - mm_segment_t oldfs;
46 u8 *data_p = buff;
47 ssize_t ret;
48
49 @@ -1355,13 +1350,10 @@ static ssize_t mwl_debugfs_ba_hist_read(
50 memset(file_location, 0, sizeof(file_location));
51 sprintf(file_location, "/tmp/ba_histo-%d", priv->ba_aid);
52
53 - oldfs = get_fs();
54 - set_fs(KERNEL_DS);
55 filp_bahisto = filp_open(file_location,
56 O_RDWR | O_CREAT | O_TRUNC, 0);
57
58 if (IS_ERR(filp_bahisto)) {
59 - set_fs(oldfs);
60 ret = -EIO;
61 goto err;
62 }
63 @@ -1402,8 +1394,8 @@ static ssize_t mwl_debugfs_ba_hist_read(
64
65 /* Buffer is full. Write to file and reset buf */
66 if ((strlen(buff) + 36) >= 500) {
67 - vfs_write(filp_bahisto, buff, strlen(buff),
68 - &filp_bahisto->f_pos);
69 + kernel_write(filp_bahisto, buff, strlen(buff),
70 + &filp_bahisto->f_pos);
71 mdelay(2);
72 memset(buff, 0, sizeof(buff));
73 data_p = buff;
74 @@ -1427,8 +1419,8 @@ static ssize_t mwl_debugfs_ba_hist_read(
75 data_p += sprintf(data_p, "%8d\n", nobaflag);
76 }
77
78 - vfs_write(filp_bahisto, buff, strlen(buff),
79 - &filp_bahisto->f_pos);
80 + kernel_write(filp_bahisto, buff, strlen(buff),
81 + &filp_bahisto->f_pos);
82 len += scnprintf(p + len, size - len,
83 "hole: %d, expect: %d, bmap0: %d, noba: %d\n",
84 baholecnt, baexpcnt, bmap0cnt, nobacnt);
85 @@ -1441,7 +1433,6 @@ static ssize_t mwl_debugfs_ba_hist_read(
86 priv->ba_aid);
87
88 filp_close(filp_bahisto, current->files);
89 - set_fs(oldfs);
90
91 ret = simple_read_from_buffer(ubuf, count, ppos, p, len);
92