]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
eeprom: idt_89hpesx: Put fwnode in matching case during ->probe()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 7 Jun 2021 22:17:55 +0000 (01:17 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:25 +0000 (09:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit 3f6ee1c095156a74ab2df605af13020f1ce3e600 ]

device_get_next_child_node() bumps a reference counting of a returned variable.
We have to balance it whenever we return to the caller.

Fixes: db15d73e5f0e ("eeprom: idt_89hpesx: Support both ACPI and OF probing")
Cc: Huy Duong <qhuyduong@hotmail.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210607221757.81465-1-andy.shevchenko@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/misc/eeprom/idt_89hpesx.c

index 81c70e5bc168f491b84e3445fa71f89a0b551b3c..45a61a1f9e98ab465d565d475eeb82cc6931447c 100644 (file)
@@ -1161,6 +1161,7 @@ static void idt_get_fw_data(struct idt_89hpesx_dev *pdev)
        else /* if (!fwnode_property_read_bool(node, "read-only")) */
                pdev->eero = false;
 
+       fwnode_handle_put(fwnode);
        dev_info(dev, "EEPROM of %d bytes found by 0x%x",
                pdev->eesize, pdev->eeaddr);
 }