|
@@ -106,7 +106,8 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
|
|
|
|
|
|
memset(line, 0, LINE_SIZE);
|
|
|
|
|
|
- length = strncpy_from_user(line, buf, LINE_SIZE - 1);
|
|
|
+ len = min_t(size_t, len, LINE_SIZE - 1);
|
|
|
+ length = strncpy_from_user(line, buf, len);
|
|
|
if (length < 0)
|
|
|
return length;
|
|
|
|