diff options
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index d1bd99271066..9045c5f3734e 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -868,7 +868,8 @@ static ssize_t driver_override_store(struct device *dev, | |||
868 | struct platform_device *pdev = to_platform_device(dev); | 868 | struct platform_device *pdev = to_platform_device(dev); |
869 | char *driver_override, *old, *cp; | 869 | char *driver_override, *old, *cp; |
870 | 870 | ||
871 | if (count > PATH_MAX) | 871 | /* We need to keep extra room for a newline */ |
872 | if (count >= (PAGE_SIZE - 1)) | ||
872 | return -EINVAL; | 873 | return -EINVAL; |
873 | 874 | ||
874 | driver_override = kstrndup(buf, count, GFP_KERNEL); | 875 | driver_override = kstrndup(buf, count, GFP_KERNEL); |