Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3319503imu; Sun, 11 Nov 2018 12:16:49 -0800 (PST) X-Google-Smtp-Source: AJdET5cZXA1e1VF3VHyhly/mdICMDWH7YK8suFfWSH31OJQDHQaoZU4w5lyptkXJvuJ/lnWCRflE X-Received: by 2002:a17:902:6113:: with SMTP id t19-v6mr17128576plj.84.1541967409201; Sun, 11 Nov 2018 12:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541967409; cv=none; d=google.com; s=arc-20160816; b=ordwe2NCz0Qa3Gz4mX344DTry4lHIijOEPWTJDlfw0aHWy8zi/Bjzv9P9O5dipXXpm mE+vmAP4tL2sPSK4zHN0y1HpqNczd756L3eS2z/jUfRHAiH0ehSEWbVL2VVqAFl+B8lE IrK/LN4oW4zSzhkP4v0MYv9FBQ2qJ0ooNx8h+n++Pl61MbGgWj5egFWcYVaZ/58SOLsL QdfFNOz4Q4NNgQ96LJodGEtFeOQxxqSLn0Lr+zCgZE17TIJoslicyie7rFcLrxzY7Jed X5f7gJgpSidd7R0QyI/peZeOUF9AATAI9oFx8MorsJ2++tkqar3DK2zX2iu8xrlEW0Kb t7Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=bRewTuNrKz2P1fT2k4q9glKosd70qoZh/EibuceDwVc=; b=YFsjAx29P6Nsa9vU3v4jl1lCk9sFvx3Tjp99zy5W7eVnMy3JMjQ5gwtAdEdJ5OfAkt biOIhWZ+i99BACegPq1IZQPw4Z32v2tVC8aipp7H18kObqSRTl01Lf4L8WAg89jhixin IccEfIwnrsWk+Q2xB0ijbSW+rYrLmgE3J7/77xk/FTFKQ9+M7ap2BvnTcXCRDy3GzHda bcn5Ef2m1QAKf2Xe27ryLuf09NvPqufyXRKpnMjoUceZkZfU/nlR7rwgEFKThHWpHpza SPRrOsv/UBC4dtOT4R8VE6Qmb1303MjKQTCM0pf9y5haXP2rXxFIiB0FNgEAeMmn0BYc cbWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 133si13171481pge.246.2018.11.11.12.16.32; Sun, 11 Nov 2018 12:16:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731739AbeKLGFn (ORCPT + 99 others); Mon, 12 Nov 2018 01:05:43 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:53126 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731140AbeKLGFn (ORCPT ); Mon, 12 Nov 2018 01:05:43 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvt1-0000oJ-UE; Sun, 11 Nov 2018 19:59:12 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsS-0001Xb-0A; Sun, 11 Nov 2018 19:58:36 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Daniel Thompson" , "Lee Jones" , "Johan Hovold" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 133/366] backlight: as3711_bl: Fix Device Tree node leaks In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit d5318d302e7cf6583ec85a2a8bfbb3a3910ae372 upstream. Two framebuffer device-node names were looked up during probe, but were only used as flags to indicate the presence of two framebuffer device. Drop the unused framebuffer name along with a likewise unused device pointer from the driver data, and update the platform data to pass in booleans instead of the framebuffer strings. This allows us do drop the node references acquired during probe, which would otherwise leak. Note that there are no other in-kernel users of the modified platform-data fields. Fixes: 59eb2b5e57ea ("drivers/video/backlight/as3711_bl.c: add OF support") Signed-off-by: Johan Hovold Acked-by: Daniel Thompson Signed-off-by: Lee Jones Signed-off-by: Ben Hutchings --- drivers/video/backlight/as3711_bl.c | 12 ++++++------ include/linux/mfd/as3711.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) --- a/drivers/video/backlight/as3711_bl.c +++ b/drivers/video/backlight/as3711_bl.c @@ -28,8 +28,6 @@ enum as3711_bl_type { struct as3711_bl_data { bool powered; - const char *fb_name; - struct device *fb_dev; enum as3711_bl_type type; int brightness; struct backlight_device *bl; @@ -273,7 +271,9 @@ static int as3711_backlight_parse_dt(str fb = of_parse_phandle(bl, "su1-dev", 0); if (fb) { - pdata->su1_fb = fb->full_name; + of_node_put(fb); + + pdata->su1_fb = true; ret = of_property_read_u32(bl, "su1-max-uA", &pdata->su1_max_uA); if (pdata->su1_max_uA <= 0) @@ -286,7 +286,9 @@ static int as3711_backlight_parse_dt(str if (fb) { int count = 0; - pdata->su2_fb = fb->full_name; + of_node_put(fb); + + pdata->su2_fb = true; ret = of_property_read_u32(bl, "su2-max-uA", &pdata->su2_max_uA); if (pdata->su2_max_uA <= 0) @@ -425,7 +427,6 @@ static int as3711_backlight_probe(struct if (pdata->su1_fb) { su = &supply->su1; - su->fb_name = pdata->su1_fb; su->type = AS3711_BL_SU1; max_brightness = min(pdata->su1_max_uA, 31); @@ -436,7 +437,6 @@ static int as3711_backlight_probe(struct if (pdata->su2_fb) { su = &supply->su2; - su->fb_name = pdata->su2_fb; su->type = AS3711_BL_SU2; switch (pdata->su2_fbprot) { --- a/include/linux/mfd/as3711.h +++ b/include/linux/mfd/as3711.h @@ -107,9 +107,9 @@ struct as3711_regulator_pdata { }; struct as3711_bl_pdata { - const char *su1_fb; + bool su1_fb; int su1_max_uA; - const char *su2_fb; + bool su2_fb; int su2_max_uA; enum as3711_su2_feedback su2_feedback; enum as3711_su2_fbprot su2_fbprot;