Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1518129pxk; Fri, 25 Sep 2020 17:52:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlIZhuThDiyKO/1n7Ixvhi0BFiBCyyXJXEytmd/v/l38xpoWmpouxb3NxICg+aE//0yvAX X-Received: by 2002:a17:906:8543:: with SMTP id h3mr5280028ejy.258.1601081568160; Fri, 25 Sep 2020 17:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601081568; cv=none; d=google.com; s=arc-20160816; b=RGkrKhNrTVni8ITaP0ZqoP1+l5BsIU419sv5x67a1Mys+OSp9jJv2vzQjOFTpU4IPo 5uWIK134aZ+t+xyL9xpRVSsZ5kqfx9poWGqcN7lQZPwhb0arj9H7dHWImDoVNy8wliYb G9Hw4rF02i/qdKJrPb+rulpA81LP9Cvf/gBuqJFPYNGVce/QrXh21rssSmz/JphsEpR8 soXmjKVMce63nhEgokN2M2kPeJFnb7R8IsFNYZJ+GWsTmiiPWX2BBMDKPJbb9Qx/Pcim epj0CVn8IurJO86sHcQq9QKxXoWDdVs9LC7npgeKAkwLoYJENZpmXgkhM3uIiXrrLO4W Kd9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=TZyjnBzoE2/S9m4k3lNqf7aWmIHJjCJ8EiJTOaZyRJA=; b=TMVdXRJJwLCP0udW8gD2qZZVqAsSr89nJ66pMfuVYeyASlcUC7QIRzOOnghybihNL3 EOhG4IS8eBI8tEDwtw5C80WMqD0HUjEEPJ+C9JDLQGl2Fl+Ge3MNlXH59ujakQUvyZ0S tTJdSXsGaufg0A1VP1Qi1ExQM4nvL9yRpumHy7MAT38kmuCWf72XZkLfHfQz5Jdkh1i/ tTJMy9ZDd/zoP8beRo6mZoomLkzeCNkZArQb5W4QwLSCQdeC0MVxn73D4aXg3Sv7zOtU DbELVtgg7LI3bCVVxf9nj7zo20QU+o3XOyI/GLK0VDFS351XTaYmD30VyNg2DO+n9dAx +wqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si2729781ejy.600.2020.09.25.17.52.23; Fri, 25 Sep 2020 17:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729505AbgIZAvT (ORCPT + 99 others); Fri, 25 Sep 2020 20:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729424AbgIZAvT (ORCPT ); Fri, 25 Sep 2020 20:51:19 -0400 Received: from agrajag.zerfleddert.de (agrajag.zerfleddert.de [IPv6:2a01:4f8:bc:1de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 695C6C0613CE; Fri, 25 Sep 2020 17:51:19 -0700 (PDT) Received: by agrajag.zerfleddert.de (Postfix, from userid 1000) id CB7965B20807; Sat, 26 Sep 2020 02:51:17 +0200 (CEST) Date: Sat, 26 Sep 2020 02:51:17 +0200 From: Tobias Jordan To: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Dan Murphy , Jean-Jacques Hiblot , Tomi Valkeinen , Marek Behun Subject: [PATCH v2] leds: tlc591xx: fix leak of device node iterator Message-ID: <20200926005117.GA32209@agrajag.zerfleddert.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In one of the error paths of the for_each_child_of_node loop in tlc591xx_probe, add missing call to of_node_put. Fixes: 1ab4531ad132 ("leds: tlc591xx: simplify driver by using the managed led API") Signed-off-by: Tobias Jordan --- v2: rebased to Pavel's for-next branch drivers/leds/leds-tlc591xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c index f24271337bd8..5b9dfdf743ec 100644 --- a/drivers/leds/leds-tlc591xx.c +++ b/drivers/leds/leds-tlc591xx.c @@ -205,10 +205,12 @@ tlc591xx_probe(struct i2c_client *client, led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS; err = devm_led_classdev_register_ext(dev, &led->ldev, &init_data); - if (err < 0) + if (err < 0) { + of_node_put(child); return dev_err_probe(dev, err, "couldn't register LED %s\n", led->ldev.name); + } } return 0; } -- 2.20.1