From patchwork Tue Oct 27 13:52:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 311850 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F0C7C4363A for ; Tue, 27 Oct 2020 17:56:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB67B2076D for ; Tue, 27 Oct 2020 17:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603821411; bh=TqZIMtcPRGxicGhzsyZKtIsWlsRediNHd8EMURjpfJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tXAtGd3iSPqscUbWzC7BOX+7GyJZwm4owOu0ps3v3vyNixGvUAcBiMHhSqvLx9fgL pLjuUQjW5gmKWvaKSWpLrvxhwYqLuBbYPAMqeDjYdkziY8gE8iOFM4jl3GFJ0iKiXq 8sFbXboeT2UsOlaBEs/JDe0Qy9HzMQRbWQUb0I7I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409055AbgJ0R4t (ORCPT ); Tue, 27 Oct 2020 13:56:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:45804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2901235AbgJ0OVb (ORCPT ); Tue, 27 Oct 2020 10:21:31 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D96CB2072D; Tue, 27 Oct 2020 14:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808490; bh=TqZIMtcPRGxicGhzsyZKtIsWlsRediNHd8EMURjpfJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZBIiOmXu59cALs6NMy16abo+8504Q5/lAxuxOlZQfrnndiL8p2npTAWx9GqMaSGY 7omnxGJx4PzYiAsulcDJ6b4bNadm7Xx5Z9gnnGosud44UqVVV7fD2jdFYEU4EKE0sd e6fHRx3rRnmHgjGT7HGv1/K8DuWKEhtLC3Z0L6y4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Daniel Thompson , Lee Jones , Sasha Levin Subject: [PATCH 4.19 081/264] backlight: sky81452-backlight: Fix refcount imbalance on error Date: Tue, 27 Oct 2020 14:52:19 +0100 Message-Id: <20201027135434.505024520@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135430.632029009@linuxfoundation.org> References: <20201027135430.632029009@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: dinghao.liu@zju.edu.cn [ Upstream commit b7a4f80bc316a56d6ec8750e93e66f42431ed960 ] When of_property_read_u32_array() returns an error code, a pairing refcount decrement is needed to keep np's refcount balanced. Fixes: f705806c9f355 ("backlight: Add support Skyworks SKY81452 backlight driver") Signed-off-by: Dinghao Liu Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/video/backlight/sky81452-backlight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c index d414c7a3acf5a..a2f77625b7170 100644 --- a/drivers/video/backlight/sky81452-backlight.c +++ b/drivers/video/backlight/sky81452-backlight.c @@ -207,6 +207,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt( num_entry); if (ret < 0) { dev_err(dev, "led-sources node is invalid.\n"); + of_node_put(np); return ERR_PTR(-EINVAL); }