arm64: dts: rockchip: add the IPA needed parameters for rk3399 thermal
[firefly-linux-kernel-4.4.55.git] / drivers / remoteproc / remoteproc_debugfs.c
index 157a573096011a07d7e30cd40ce88166b9465c28..916af5096f57b93b7f7e148d28716329b31c7be6 100644 (file)
@@ -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);
@@ -248,6 +248,5 @@ void __init rproc_init_debugfs(void)
 
 void __exit rproc_exit_debugfs(void)
 {
-       if (rproc_dbg)
-               debugfs_remove(rproc_dbg);
+       debugfs_remove(rproc_dbg);
 }