media: i2c: rk628: fix debugfs NULL parameter

Fixes: 84b8365717 ("media: i2c: rk628: fix debugfs "rk628" parent directory")

Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: Ie6e0fd8439c4dcbd9e432f3ec0a47e72bce989ab
This commit is contained in:
Jianwei Fan
2025-08-07 10:44:48 +08:00
committed by 范建威
parent 6780c6bb81
commit 79eeda1e56

View File

@@ -512,9 +512,10 @@ void rk628_debugfs_create(struct rk628 *rk628)
struct dentry *debugfs, *debugfs_tmp = debugfs_lookup("rk628", NULL);
debugfs = debugfs_tmp;
if (!debugfs)
if (IS_ERR_OR_NULL(debugfs))
debugfs = debugfs_create_dir("rk628", NULL);
dput(debugfs_tmp);
if (!IS_ERR_OR_NULL(debugfs_tmp))
dput(debugfs_tmp);
rk628->debug_dir = debugfs_create_dir(dev_name(rk628->dev), debugfs);
if (IS_ERR(rk628->debug_dir))
return;