netdevsim: fix stack-out-of-bounds in nsim_dev_debugfs_init()
[platform/kernel/linux-starfive.git] / drivers / net / netdevsim / dev.c
index 06b178b..273a242 100644 (file)
@@ -73,7 +73,7 @@ static const struct file_operations nsim_dev_take_snapshot_fops = {
 
 static int nsim_dev_debugfs_init(struct nsim_dev *nsim_dev)
 {
-       char dev_ddir_name[16];
+       char dev_ddir_name[sizeof(DRV_NAME) + 10];
 
        sprintf(dev_ddir_name, DRV_NAME "%u", nsim_dev->nsim_bus_dev->dev.id);
        nsim_dev->ddir = debugfs_create_dir(dev_ddir_name, nsim_dev_ddir);