瀏覽代碼

Merge tag 'remoteproc-4.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc

Pull remoteproc fixes from Ohad Ben-Cohen:
 "Two one-liners coming from Suman and Arnd"

* tag 'remoteproc-4.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
  remoteproc: fix memory leak of remoteproc ida cache layers
  remoteproc: avoid stack overflow in debugfs file
Linus Torvalds 9 年之前
父節點
當前提交
6a24e72d23
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2 0
      drivers/remoteproc/remoteproc_core.c
  2. 1 1
      drivers/remoteproc/remoteproc_debugfs.c

+ 2 - 0
drivers/remoteproc/remoteproc_core.c

@@ -1478,6 +1478,8 @@ module_init(remoteproc_init);
 
 static void __exit remoteproc_exit(void)
 {
+	ida_destroy(&rproc_dev_index);
+
 	rproc_exit_debugfs();
 }
 module_exit(remoteproc_exit);

+ 1 - 1
drivers/remoteproc/remoteproc_debugfs.c

@@ -156,7 +156,7 @@ rproc_recovery_write(struct file *filp, const char __user *user_buf,
 	char buf[10];
 	int ret;
 
-	if (count > sizeof(buf))
+	if (count < 1 || count > sizeof(buf))
 		return count;
 
 	ret = copy_from_user(buf, user_buf, count);