From patchwork Mon Aug 3 11:14:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 11697897 X-Patchwork-Delegate: pavel@denx.de Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA4A7722 for ; Mon, 3 Aug 2020 11:27:57 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 42C952076C for ; Mon, 3 Aug 2020 11:27:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.cip-project.org header.i=@lists.cip-project.org header.b="EiA0oEsF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42C952076C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bp.renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+64572+5081+4520428+8129116@lists.cip-project.org X-Received: by 127.0.0.2 with SMTP id tcXiYY4521763x2mS5PSitfE; Mon, 03 Aug 2020 04:27:57 -0700 X-Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.8800.1596453286802143413 for ; Mon, 03 Aug 2020 04:14:47 -0700 X-IronPort-AV: E=Sophos;i="5.75,429,1589209200"; d="scan'208";a="53741060" X-Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 03 Aug 2020 20:14:44 +0900 X-Received: from localhost.localdomain (unknown [172.29.53.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0552B423591D; Mon, 3 Aug 2020 20:14:42 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Chris Paterson , Biju Das , Prabhakar Mahadev Lad Subject: [cip-dev] [PATCH 4.19.y-cip] drm: of: Fix double-free bug Date: Mon, 3 Aug 2020 12:14:41 +0100 Message-Id: <20200803111441.3157-1-biju.das.jz@bp.renesas.com> Precedence: Bulk List-Unsubscribe: Sender: cip-dev@lists.cip-project.org List-Id: Mailing-List: list cip-dev@lists.cip-project.org; contact cip-dev+owner@lists.cip-project.org Delivered-To: mailing list cip-dev@lists.cip-project.org Reply-To: cip-dev@lists.cip-project.org X-Gm-Message-State: l5h9nsRi44yspuOrlRjOYmkSx4520428AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.cip-project.org; q=dns/txt; s=20140610; t=1596454077; bh=ouGwUasBCxv7H7MZmfNMz0GupVNTawUeIJhyOhbsOTo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=EiA0oEsF7HbmAlh1lj79Q8EItc41TPAoV3xA7DKEuRsQce3mPJMUzu/KsDVJbt8LfrE w0BOY1KOjQZafAuo3piaQzy1FeQUWNXJtdoHg8av9FJKNft0dD7KOTu6HBiLEqoQ3ZpIx Dhl4XwyaqfkKqhLeTc4fLyd3YfkiKee3Bns= commit 4ee48cc5586bf519df19894273002aa8ef7b70ad upstream. Fix double-free bug in the error path. Fixes: 6529007522de ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order") Reported-by: Pavel Machek Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Cc: stable@vger.kernel.org Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1595502654-40595-1-git-send-email-biju.das.jz@bp.renesas.com Signed-off-by: Biju Das --- drivers/gpu/drm/drm_of.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 4f0bc1363fbe..f2e7f953cc93 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -323,10 +323,8 @@ static int drm_of_lvds_get_remote_pixels_type( * configurations by passing the endpoints explicitly to * drm_of_lvds_get_dual_link_pixel_order(). */ - if (!current_pt || pixels_type != current_pt) { - of_node_put(remote_port); + if (!current_pt || pixels_type != current_pt) return -EINVAL; - } } return pixels_type;