Fix the incorrect return value check for debugfs_create_dir(), which returns ERR_PTR(-ERROR) instead of NULL when it fails. Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver") Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx> --- drivers/media/pci/mgb4/mgb4_vin.c | 2 +- drivers/media/pci/mgb4/mgb4_vout.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c index e9332abb31729ea..808eb51b270c755 100644 --- a/drivers/media/pci/mgb4/mgb4_vin.c +++ b/drivers/media/pci/mgb4/mgb4_vin.c @@ -860,7 +860,7 @@ static void debugfs_init(struct mgb4_vin_dev *vindev) vindev->debugfs = debugfs_create_dir(vindev->vdev.name, vindev->mgbdev->debugfs); - if (!vindev->debugfs) + if (IS_ERR(vindev->debugfs)) return; vindev->regs[0].name = "CONFIG"; diff --git a/drivers/media/pci/mgb4/mgb4_vout.c b/drivers/media/pci/mgb4/mgb4_vout.c index 998edcbd972387d..348c8e01fcbed5a 100644 --- a/drivers/media/pci/mgb4/mgb4_vout.c +++ b/drivers/media/pci/mgb4/mgb4_vout.c @@ -683,7 +683,7 @@ static void debugfs_init(struct mgb4_vout_dev *voutdev) voutdev->debugfs = debugfs_create_dir(voutdev->vdev.name, voutdev->mgbdev->debugfs); - if (!voutdev->debugfs) + if (IS_ERR(voutdev->debugfs)) return; voutdev->regs[0].name = "CONFIG"; -- 2.34.1