Message ID | 20230522072535.1523740-3-linan666@huaweicloud.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | md: bugfix of writing raid sysfs | expand |
diff --git a/drivers/md/md.c b/drivers/md/md.c index b2d69260b5b1..350094f1cb09 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4478,6 +4478,8 @@ max_corrected_read_errors_store(struct mddev *mddev, const char *buf, size_t len rv = kstrtouint(buf, 10, &n); if (rv < 0) return rv; + if (n > INT_MAX) + return -EINVAL; atomic_set(&mddev->max_corr_read_errors, n); return len; }