summaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/health.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netdevsim/health.c')
-rw-r--r--drivers/net/netdevsim/health.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/netdevsim/health.c b/drivers/net/netdevsim/health.c
index 70e8bdf34be9..688f05316b5e 100644
--- a/drivers/net/netdevsim/health.c
+++ b/drivers/net/netdevsim/health.c
@@ -149,6 +149,8 @@ static ssize_t nsim_dev_health_break_write(struct file *file,
char *break_msg;
int err;
+ if (count == 0 || count > PAGE_SIZE)
+ return -EINVAL;
break_msg = memdup_user_nul(data, count);
if (IS_ERR(break_msg))
return PTR_ERR(break_msg);