diff options
-rw-r--r-- | drivers/amba/bus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 1c25b6ee9651..93888ccb4e26 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -84,7 +84,8 @@ static ssize_t driver_override_store(struct device *_dev, struct amba_device *dev = to_amba_device(_dev); char *driver_override, *old, *cp; - if (count > PATH_MAX) + /* We need to keep extra room for a newline */ + if (count >= (PAGE_SIZE - 1)) return -EINVAL; driver_override = kstrndup(buf, count, GFP_KERNEL); |