lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 May 2021 12:50:33 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Pavel Machek <pavel@....cz>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Amireddy Mallikarjuna reddy 
        <mallikarjunax.reddy@...ux.intel.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Marek BehĂșn <marek.behun@....cz>,
        Abanoub Sameh <abanoubsameh8@...il.com>,
        Dan Murphy <dmurphy@...com>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Andy Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH v1 16/28] leds: lm36274: Put fwnode in error case during ->probe()

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

In the older code the same is implied with device_for_each_child_node().

Fixes: 11e1bbc116a7 ("leds: lm36274: Introduce the TI LM36274 LED driver")
Fixes: a448fcf19c9c ("leds: lm36274: don't iterate through children since there is only one")
Cc: Dan Murphy <dmurphy@...com>
Cc: Marek BehĂșn <marek.behun@....cz>
Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
---
 drivers/leds/leds-lm36274.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/leds/leds-lm36274.c b/drivers/leds/leds-lm36274.c
index aadb03468a40..a23a9424c2f3 100644
--- a/drivers/leds/leds-lm36274.c
+++ b/drivers/leds/leds-lm36274.c
@@ -127,6 +127,7 @@ static int lm36274_probe(struct platform_device *pdev)
 
 	ret = lm36274_init(chip);
 	if (ret) {
+		fwnode_handle_put(init_data.fwnode);
 		dev_err(chip->dev, "Failed to init the device\n");
 		return ret;
 	}
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ