| .. | .. |
|---|
| 75 | 75 | case '\r': |
|---|
| 76 | 76 | case ':': |
|---|
| 77 | 77 | *str = 0; |
|---|
| 78 | | - /* Fallthrough */ |
|---|
| 78 | + fallthrough; |
|---|
| 79 | 79 | case 0: |
|---|
| 80 | 80 | return; |
|---|
| 81 | 81 | } |
|---|
| .. | .. |
|---|
| 134 | 134 | } |
|---|
| 135 | 135 | |
|---|
| 136 | 136 | static int dn_node_address_handler(struct ctl_table *table, int write, |
|---|
| 137 | | - void __user *buffer, |
|---|
| 138 | | - size_t *lenp, loff_t *ppos) |
|---|
| 137 | + void *buffer, size_t *lenp, loff_t *ppos) |
|---|
| 139 | 138 | { |
|---|
| 140 | 139 | char addr[DN_ASCBUF_LEN]; |
|---|
| 141 | 140 | size_t len; |
|---|
| .. | .. |
|---|
| 148 | 147 | |
|---|
| 149 | 148 | if (write) { |
|---|
| 150 | 149 | len = (*lenp < DN_ASCBUF_LEN) ? *lenp : (DN_ASCBUF_LEN-1); |
|---|
| 151 | | - |
|---|
| 152 | | - if (copy_from_user(addr, buffer, len)) |
|---|
| 153 | | - return -EFAULT; |
|---|
| 154 | | - |
|---|
| 150 | + memcpy(addr, buffer, len); |
|---|
| 155 | 151 | addr[len] = 0; |
|---|
| 156 | 152 | strip_it(addr); |
|---|
| 157 | 153 | |
|---|
| .. | .. |
|---|
| 173 | 169 | len = strlen(addr); |
|---|
| 174 | 170 | addr[len++] = '\n'; |
|---|
| 175 | 171 | |
|---|
| 176 | | - if (len > *lenp) len = *lenp; |
|---|
| 177 | | - |
|---|
| 178 | | - if (copy_to_user(buffer, addr, len)) |
|---|
| 179 | | - return -EFAULT; |
|---|
| 180 | | - |
|---|
| 172 | + if (len > *lenp) |
|---|
| 173 | + len = *lenp; |
|---|
| 174 | + memcpy(buffer, addr, len); |
|---|
| 181 | 175 | *lenp = len; |
|---|
| 182 | 176 | *ppos += len; |
|---|
| 183 | 177 | |
|---|
| .. | .. |
|---|
| 185 | 179 | } |
|---|
| 186 | 180 | |
|---|
| 187 | 181 | static int dn_def_dev_handler(struct ctl_table *table, int write, |
|---|
| 188 | | - void __user *buffer, |
|---|
| 189 | | - size_t *lenp, loff_t *ppos) |
|---|
| 182 | + void *buffer, size_t *lenp, loff_t *ppos) |
|---|
| 190 | 183 | { |
|---|
| 191 | 184 | size_t len; |
|---|
| 192 | 185 | struct net_device *dev; |
|---|
| .. | .. |
|---|
| 201 | 194 | if (*lenp > 16) |
|---|
| 202 | 195 | return -E2BIG; |
|---|
| 203 | 196 | |
|---|
| 204 | | - if (copy_from_user(devname, buffer, *lenp)) |
|---|
| 205 | | - return -EFAULT; |
|---|
| 206 | | - |
|---|
| 197 | + memcpy(devname, buffer, *lenp); |
|---|
| 207 | 198 | devname[*lenp] = 0; |
|---|
| 208 | 199 | strip_it(devname); |
|---|
| 209 | 200 | |
|---|
| .. | .. |
|---|
| 238 | 229 | |
|---|
| 239 | 230 | if (len > *lenp) len = *lenp; |
|---|
| 240 | 231 | |
|---|
| 241 | | - if (copy_to_user(buffer, devname, len)) |
|---|
| 242 | | - return -EFAULT; |
|---|
| 243 | | - |
|---|
| 232 | + memcpy(buffer, devname, len); |
|---|
| 244 | 233 | *lenp = len; |
|---|
| 245 | 234 | *ppos += len; |
|---|
| 246 | 235 | |
|---|