Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5036801pxb; Mon, 15 Feb 2021 07:57:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJxA6BMfsfiUYd9zrcbzD32zp2LfnQZedXtmvxzqpFysqUqyRqDEEJ9Ir2VhvKFZkGM97b X-Received: by 2002:a17:906:4d19:: with SMTP id r25mr11492105eju.64.1613404653248; Mon, 15 Feb 2021 07:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613404653; cv=none; d=google.com; s=arc-20160816; b=jhuT6md2TTuf1QdCHk3I7p+yf85CPVgZ+WRTTFZxwx7Z7StG7eK404pNfVEc6X/V+x Ena/jZTq+5faveuug/ww2V8xu5jNhROhiJypc7AyYbJJ1RuaaiSP5moJX5MV7DtaFyn5 VBOvF79ck6TxxtuBl4HZVt8RRdZkuSC8geJrNzYHH2Llwq4iykw1t9s3GoY/gu0oN7Gm RVslPIgUK46u7VBogDIhCE8cTcbP/a3sbMUgkSuiMcO3gCwJSxoOhbzFkIUSX3LaiWqK FbyqENN9QUbnhUdd++ATl3RhUvKSL7vbNB1LHSM42de1VZng3BbKmSN781fp79uNEpAZ HYGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v8hVZlgKBcCZ/lKTECkqjGIgYAu4dPBYPNQtjAPLjqM=; b=QLLM0OeuS4teS9yXLgdkdYw3aoamgEzJacMGcsg+cZFkn9brzhsakdFi4xvcUW5V+5 x3e2s8qf397hdtUAeMvOoyhXIUkm+H56I9VBQ1jj2nCay+jY52qI7wVfBPasOlhpJFhL vbrv0ksKLQlNHb7tQqeql7kpOC3Rado+tSquwemmJbmm+tcVoJEJDbPuOsp9uYgvre0i TiW+fTURwKd+xvhNyyAAI+9VGWfezRsJ6qr0tHMjQGjUZEql7oXsu5CiisOMHzKShbxr n9PWZ/sZlQ99IG6FdHaUWlZiiX9RfjGarDU2lyF8rWH/PGOhcQ9YErxXzBOcvD2/nAN7 EIfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sxFzQ+UQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id he44si11878239ejc.386.2021.02.15.07.57.10; Mon, 15 Feb 2021 07:57:33 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sxFzQ+UQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbhBOP4Z (ORCPT + 99 others); Mon, 15 Feb 2021 10:56:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:46646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231261AbhBOPcf (ORCPT ); Mon, 15 Feb 2021 10:32:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B1C964EA3; Mon, 15 Feb 2021 15:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403003; bh=ytTvy+TUJ1gYbQDkwVCC94Pl9abxCe86fHci+vo4P8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sxFzQ+UQY1pEhVAGvAp0OgEyH+ntBf8LyXi70m2ljEgqfk0zF6wz8Skc0oXCKGwxc N3jbstFUo3uiEyN4pUZghqeV3YggeVgY3LLyTkqnkLBTbLfxI/77cSc4lRy+dys6Gz fDq1S1hhpbW18EgEJ6QszNLEYrL1mRRt4thdxsLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Victor Lu , Nicholas Kazlauskas , Anson Jacob , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 16/60] drm/amd/display: Fix dc_sink kref count in emulated_link_detect Date: Mon, 15 Feb 2021 16:27:04 +0100 Message-Id: <20210215152715.896134983@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152715.401453874@linuxfoundation.org> References: <20210215152715.401453874@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Victor Lu [ Upstream commit 3ddc818d9bb877c64f5c649beab97af86c403702 ] [why] prev_sink is not used anywhere else in the function and the reference to it from dc_link is replaced with a new dc_sink. [how] Change dc_sink_retain(prev_sink) to dc_sink_release(prev_sink). Signed-off-by: Victor Lu Reviewed-by: Nicholas Kazlauskas Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index de06ee7d2ad46..3671b3e8f69d8 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1093,8 +1093,8 @@ static void emulated_link_detect(struct dc_link *link) link->type = dc_connection_none; prev_sink = link->local_sink; - if (prev_sink != NULL) - dc_sink_retain(prev_sink); + if (prev_sink) + dc_sink_release(prev_sink); switch (link->connector_signal) { case SIGNAL_TYPE_HDMI_TYPE_A: { -- 2.27.0