media: nuvoton: Fix reference handling of ece_node
commit 8ba4ef40ad6ca62368292a69855324213181abfb upstream.
Make sure all the code paths call of_node_put().
Instead of manually calling of_node_put, use the __free macros/helpers.
Cc: stable@vger.kernel.org
Fixes: 46c15a4ff1 ("media: nuvoton: Add driver for NPCM video capture and encoding engine")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e22fa60bcd
commit
4b1bdaadbf
@@ -1650,8 +1650,8 @@ rel_ctrl_handler:
|
|||||||
|
|
||||||
static int npcm_video_ece_init(struct npcm_video *video)
|
static int npcm_video_ece_init(struct npcm_video *video)
|
||||||
{
|
{
|
||||||
|
struct device_node *ece_node __free(device_node) = NULL;
|
||||||
struct device *dev = video->dev;
|
struct device *dev = video->dev;
|
||||||
struct device_node *ece_node;
|
|
||||||
struct platform_device *ece_pdev;
|
struct platform_device *ece_pdev;
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
|
|
||||||
@@ -1671,7 +1671,6 @@ static int npcm_video_ece_init(struct npcm_video *video)
|
|||||||
dev_err(dev, "Failed to find ECE device\n");
|
dev_err(dev, "Failed to find ECE device\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
of_node_put(ece_node);
|
|
||||||
|
|
||||||
regs = devm_platform_ioremap_resource(ece_pdev, 0);
|
regs = devm_platform_ioremap_resource(ece_pdev, 0);
|
||||||
if (IS_ERR(regs)) {
|
if (IS_ERR(regs)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user