From patchwork Mon Aug 3 12:18:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266790 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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 91B7AC433E0 for ; Mon, 3 Aug 2020 12:54:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A82A2064B for ; Mon, 3 Aug 2020 12:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596459258; bh=wbwrot403Bej2kBXG1WXcLb0qTZioUMIwWbSmNXGX5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lIOV+3xfBdBZ64yK0DE4I44QR51yw8pmrFB4gnpPC6xOlYpmyRMeqN/TZhYXQOolO 8dR5WQ0U/Wbo/qoqXF1eMRuxaWhntqo2ZfradD8pCNKhGq4P/e01+fP0pz05Doz7OZ NV3Emj+dNCpkTykH0RV+INQNUBR7+d1mPBsPE0w8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727877AbgHCMXe (ORCPT ); Mon, 3 Aug 2020 08:23:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:47610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727874AbgHCMXa (ORCPT ); Mon, 3 Aug 2020 08:23:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 942A6204EC; Mon, 3 Aug 2020 12:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596457409; bh=wbwrot403Bej2kBXG1WXcLb0qTZioUMIwWbSmNXGX5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tr6y4hvs/bbR8DxfdOGaeLpJcYzv0OXcnXPcrt67m13rrDx8rBlaH+uo3aPZSQua/ v9VJ+wUejAZTLDzGFvLOkvzuWJxgbelfoHcsCC0P3kTno090r9oWlPVuTGPBvkWs5D g3dvS0cfzXU3fZwgtoBfU6PTAydIglaiIQDs3wZo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Biju Das , Laurent Pinchart , Sam Ravnborg Subject: [PATCH 5.7 029/120] drm: of: Fix double-free bug Date: Mon, 3 Aug 2020 14:18:07 +0200 Message-Id: <20200803121904.257261085@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121902.860751811@linuxfoundation.org> References: <20200803121902.860751811@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Biju Das 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: Greg Kroah-Hartman --- drivers/gpu/drm/drm_of.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -322,10 +322,8 @@ static int drm_of_lvds_get_remote_pixels * 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;