Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2382048lqp; Sun, 24 Mar 2024 16:57:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrl1cjqG7RHJrftLAl9ykcxrsOS2zqgTE6CXeO2Ws07J3yKJdcUw03f3uyF+kHgWqciASIugWNY9zscSi5j7mEGtuIHXtXYSItusOFTw== X-Google-Smtp-Source: AGHT+IHDXieyO4E3cMhQdv6b0stxZdHAPmhqjPWV0bmX8xC5a5sz3Cc8VMr9faWs3bXvn3hoTyYh X-Received: by 2002:a05:6808:60c:b0:3c3:adc6:8935 with SMTP id y12-20020a056808060c00b003c3adc68935mr6372632oih.14.1711324667679; Sun, 24 Mar 2024 16:57:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324667; cv=pass; d=google.com; s=arc-20160816; b=clUo23nAGRwgOK8KxIWtODx3y8prTOScJUz8vU0TZ3LiAo1KyLGk5u4h6oke9Sk8sY 5xR4ukdXZaPwJhH92a2IPEOoEuCGpGSLRsypqWdpS2yfIm9qedj+NGWbFUUXQJwQck1A e1Ll8Eb8BVP5DsRbw/9E4aygpFPe82FSAfFAu7eC1+ytvI0rZNBbw2JcPeE1xGImHSJD CqGJcnR4+1hyLxa3xV4/vjNknNhfXb3KcIsbLJ7ogjxQ1/CXy8bYRlhFq+YruOY4iV4D u39M+7uRH1zvvsobYi4hk/B8HaVgu5aQMBTsowHskrF3YbVC1lwvwIAXg8+UsieeLX8v S7Dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=fe4Kkd0ALyG+5xqGOPQzFio0yW7/aWv5aKvoGheBtgw=; fh=4RGyyjZTpuBUGR1TesKnLTwS9HCKIISg2vxTmZH992k=; b=x9px3tuYbzlTyhsQqXsr+o347wlSiaWG3l9YDMupbCcxZqwgQM+4GWhCsVXGfEowvx PkjdBwSFAF0uqMzqH3O6tVcOeNyAD8bcWPqe23dOoXS+IxVspg5cRErNOCBz9RhGzN16 eDpaxKhq6/EDfvQ6scwmMz02pkPQ8q3Nalt1naWIH6cjU+OgE74WnXIFKtnpDKd8iFJD M7LU0O0RzuvCdArtggwNVgPc48Z2T6vqMXd44FrHA21iv7KQmWNCvXdjERx+Is8Qt07t wNnUrCwSx/BeqO4SC1S07BJgm9uDDyN8bIsFGJAj7BrHR+X6GzXM96QH/xp/ZD+ly9uz J7Lg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SUCzykO8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113248-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v11-20020a63480b000000b005dc49c4dfc7si6526681pga.471.2024.03.24.16.57.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:57:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SUCzykO8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113248-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4A7B3285ECF for ; Sun, 24 Mar 2024 23:53:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 498C31869C5; Sun, 24 Mar 2024 22:40:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SUCzykO8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3617518638C; Sun, 24 Mar 2024 22:40:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320048; cv=none; b=qw31kFzBM+m7le0AjqXYoMJGJ3uh/q79zhp6IXgXK2WTRZQYnWcTXieFWDKhx8PRCUR4WyaN4dba6QR5vDzFkGpoOYCQnfr1hl6Ad8zedMUahN0coZprWbn9PfZiMgxf9lZ41jlAVtn7HtqWDx+QiIOb/N1vESDW/L8AqBn83cU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320048; c=relaxed/simple; bh=HiFTlZ3SKcc4YSHufcREYcJE8gSsUS12Vn56iUfMUs4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K3yoHyvnDwRIwJcEnCNDxgK7NcjrGwFLT6ZkZfFSdEQ6SkKgX9y4f37YFIXLQ8DwlqlRqDYYDRNqN2YW2eB5pdMoswqBWSj++uu8Brt6w8ou3wcZlUMugeYmPgAJG1LG43qwc5NJYynFHVUE252Sor75BuqegP7DnidWKlzADPc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SUCzykO8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75E2FC433C7; Sun, 24 Mar 2024 22:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320048; bh=HiFTlZ3SKcc4YSHufcREYcJE8gSsUS12Vn56iUfMUs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SUCzykO8QO3y3Vd3LKq2FkZ8xRb3zNvwa+LlIT5kHISwA0xmnmbdlMhiqNAT0ZANX 3mRmWF9DSU8KAQVlDUkS6KIuggmc49P2KgObzkFzEFOF1RouxIY3NozRBuMBt2ZYRM LabISNei/YEtNlQ4TZ6/PlCQHU3Irs+jJImsTjxWsyr9qRcWoXUD/YmTU7XGw+vtYp +qjf8/wfeQ0siKUMa6hKazRYxIE0vZDP59pH2ASB1EraGa8knRybhrL/68A907G85Q s/wIT/DR2+emFP8HZCi5hmzCWG6mgQsbvwJaePeICgsdpiQeQksWCaHsF2qi6YkJUd 7a5PIQzg8u5vQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Thierry Reding , Sasha Levin Subject: [PATCH 6.8 357/715] drm/tegra: output: Fix missing i2c_put_adapter() in the error handling paths of tegra_output_probe() Date: Sun, 24 Mar 2024 18:28:56 -0400 Message-ID: <20240324223455.1342824-358-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Christophe JAILLET [ Upstream commit 2db4578ef6ffb2b52115ca0ebf897b60ec559556 ] If an error occurs after a successful of_get_i2c_adapter_by_node() call, it should be undone by a corresponding i2c_put_adapter(). Add the missing i2c_put_adapter() call. Fixes: 9be7d864cf07 ("drm/tegra: Implement panel support") Signed-off-by: Christophe JAILLET Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/b38604178991e1f08b2cda219103be266be2d680.1693667005.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/gpu/drm/tegra/output.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index dc2dcb5ca1c89..d7d2389ac2f5a 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -142,8 +142,10 @@ int tegra_output_probe(struct tegra_output *output) GPIOD_IN, "HDMI hotplug detect"); if (IS_ERR(output->hpd_gpio)) { - if (PTR_ERR(output->hpd_gpio) != -ENOENT) - return PTR_ERR(output->hpd_gpio); + if (PTR_ERR(output->hpd_gpio) != -ENOENT) { + err = PTR_ERR(output->hpd_gpio); + goto put_i2c; + } output->hpd_gpio = NULL; } @@ -152,7 +154,7 @@ int tegra_output_probe(struct tegra_output *output) err = gpiod_to_irq(output->hpd_gpio); if (err < 0) { dev_err(output->dev, "gpiod_to_irq(): %d\n", err); - return err; + goto put_i2c; } output->hpd_irq = err; @@ -165,7 +167,7 @@ int tegra_output_probe(struct tegra_output *output) if (err < 0) { dev_err(output->dev, "failed to request IRQ#%u: %d\n", output->hpd_irq, err); - return err; + goto put_i2c; } output->connector.polled = DRM_CONNECTOR_POLL_HPD; @@ -179,6 +181,12 @@ int tegra_output_probe(struct tegra_output *output) } return 0; + +put_i2c: + if (output->ddc) + i2c_put_adapter(output->ddc); + + return err; } void tegra_output_remove(struct tegra_output *output) -- 2.43.0