media: pci: mgb4: Fix return value check in debugfs_init()
Subsystems (2)
PATCH 1/1 media: pci: mgb4: Fix return value check in debugfs_init()
Fix the incorrect return value check for debugfs_create_dir(), which returns ERR_PTR(-ERROR) instead of NULL when it fails.
--- drivers/media/pci/mgb4/mgb4_vin.c | 2 +- drivers/media/pci/mgb4/mgb4_vout.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/pci/mgb4/mgb4_vin.c +1 -1
@@ -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" ;
drivers/media/pci/mgb4/mgb4_vout.c +1 -1
@@ -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" ;
Signature · 1 line
2.34.1
Quoted 28 lines · Zhen Lei
Fix the incorrect return value check for
debugfs_create_dir(), which returnsERR_PTR(-ERROR)instead of NULL when it fails.Fixes 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")Signed-off-by Zhen Lei <[email protected]>--- drivers/media/pci/mgb4/mgb4_vin.c | 2 +- drivers/media/pci/mgb4/mgb4_vout.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/media/pci/mgb4/mgb4_vin.c +1
-1@@ -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" ;drivers/media/pci/mgb4/mgb4_vout.c +0
-0
drivers/media/pci/mgb4/mgb4_vout.c static void debugfs_init(struct mgb4_vout_dev *voutdev) · line 689
Quoted 8 lines
drivers/media/pci/mgb4/mgb4_vout.c +1
-1@@ -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" ;
This issue has already been addressed and fixed, see the v4l2 media.git branch:
https://git.linuxtv.org/media.git/tree/drivers/media/pci/mgb4/mgb4_vin.c https://git.linuxtv.org/media.git/tree/drivers/media/pci/mgb4/mgb4_vout.c
M.
Quoted 28 lines · Martin Tůma
Quoted 27 lines · Zhen Lei
Fix the incorrect return value check for
debugfs_create_dir(), which returnsERR_PTR(-ERROR)instead of NULL when it fails.Fixes 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")Signed-off-by Zhen Lei <[email protected]>---
drivers/media/pci/mgb4/mgb4_vin.c | 2 +-
drivers/media/pci/mgb4/mgb4_vout.c| 2 +-2 files changed, 2 insertions(+), 2 deletions(-)drivers/media/pci/mgb4/mgb4_vin.c +1
-1@@ -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";drivers/media/pci/mgb4/mgb4_vout.c +0
-0@@ -683,7 +683,7 @@ static void debugfs_init(struct mgb4_vout_dev *voutdev)
Quoted 8 lines
drivers/media/pci/mgb4/mgb4_vout.c static void debugfs_init(struct mgb4_vout_dev *voutdev) · line 689
Quoted 6 lines
drivers/media/pci/mgb4/mgb4_vout.c +1
-1voutdev->debugfs = debugfs_create_dir(voutdev->vdev.name, voutdev->mgbdev->debugfs); - if (!voutdev->debugfs) + if (IS_ERR(voutdev->debugfs)) return; voutdev->regs[0].name = "CONFIG";This issue has already been addressed and fixed, see the v4l2 media.git branch:
v4l2 media.git next branch
Quoted 37 lines · Martin Tůma
Quoted 27 lines · Martin Tůma
Quoted 26 lines · Zhen Lei
Fix the incorrect return value check for
debugfs_create_dir(), which returnsERR_PTR(-ERROR)instead of NULL when it fails.Fixes 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")Signed-off-by Zhen Lei <[email protected]>---
drivers/media/pci/mgb4/mgb4_vin.c | 2 +-
drivers/media/pci/mgb4/mgb4_vout.c| 2 +-2 files changed, 2 insertions(+), 2 deletions(-)drivers/media/pci/mgb4/mgb4_vin.c +1
-1@@ -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";drivers/media/pci/mgb4/mgb4_vout.c +0
-0@@ -683,7 +683,7 @@ static void debugfs_init(struct mgb4_vout_dev *voutdev)Quoted 8 lines
drivers/media/pci/mgb4/mgb4_vout.c static void debugfs_init(struct mgb4_vout_dev *voutdev) · line 689
Quoted 6 lines
drivers/media/pci/mgb4/mgb4_vout.c +1
-1voutdev->debugfs = debugfs_create_dir(voutdev->vdev.name, voutdev->mgbdev->debugfs); - if (!voutdev->debugfs) + if (IS_ERR(voutdev->debugfs)) return; voutdev->regs[0].name = "CONFIG";This issue has already been addressed and fixed, see the v4l2 media.git branch:
Quoted 1 line
v4l2 media.git next branch
OK, I see it, thanks.
Quoted 9 lines
Quoted 6 lines
https://git.linuxtv.org/media.git/tree/drivers/media/pci/mgb4/mgb4_vin.c https://git.linuxtv.org/media.git/tree/drivers/media/pci/mgb4/mgb4_vout.c
M.
.
Signature · 2 lines
Regards, Zhen Lei