Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9043427pxu; Mon, 28 Dec 2020 05:15:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxT4Ebuq8dqS2HCJOhrLhc7cK7GEbaIXaiVPNRUdAfRmWpjaUq+gu/J+tVUr7Xy+EmVDzuF X-Received: by 2002:a17:907:a8a:: with SMTP id by10mr40919943ejc.423.1609161308289; Mon, 28 Dec 2020 05:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161308; cv=none; d=google.com; s=arc-20160816; b=AMEs9jPhukuaFLVbNjkSpBDIAeUWOT8R499OGJqtVi/OwOPQuN/2m5WypWwsUIaUqP ki2UZlpXxGyttxfPe0nbbOUY/cnn/9f/gvaN+MJMCLKSCXZ7D2eTtycyBE/affc31sor P+KxgBH5/lkIFHb7Qs1yJ5IVuexxiEggXTgHw0LZORSPJTBJdDh1B086g3nG9Aym0IrN GLqHvDeLhkEMtsD2L+FrizumRVUpLMYFV7hsRaEP+GpkGnmr7C17IfWXDIp4pueWHJXM tv48P2o8tV+SyLwEX2th6zUBW5uFkqcrYhvTIJIf7gUwylRXBzsqujF+kSDWoBr0+Xm8 ZedA== 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=XzzMgRgGAbgPFz3kNCIw2UfcmdUOQCC6GA+XQ1WVrd0=; b=wHGYREXHTdMB+QXJ+GtJT9+sHR2e3DFfyEQWECSJAOwyIW9OU8AZ1y5V5gxGjak9Qd Ittu4z6B1CcdxR2ydnGGS3Q97wRP2lB/ryNU+F1l9sBJupzWqTkK1MS7bdXdZalP1cik mks17FJtQJtmDQiLaVWzLP6xDEWXiqYAWKMXzDnZ6c6al8iTpf9wJ1xjTy/HTomAhuWy +QcWqjgQL1hltK94jGLHyOYa/Vt5I2qUe0GOzhPJJv2qV4aYZwgcZnzpRX5FP0qpOVaa 2at3C35yxw06d+t1J2PzuXBHt90yteLPlhdlJyy1p8KhdmCpg3zQWcNpaPP0RLTZ435P G3yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z0dTyJxa; 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 f5si18785128ejd.332.2020.12.28.05.14.45; Mon, 28 Dec 2020 05:15:08 -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=Z0dTyJxa; 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 S1731347AbgL1NKS (ORCPT + 99 others); Mon, 28 Dec 2020 08:10:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:37698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731316AbgL1NKM (ORCPT ); Mon, 28 Dec 2020 08:10:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B40E620728; Mon, 28 Dec 2020 13:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160997; bh=UM07LVbFrKGNSwO8zjsZD2hQhntSihKDIJTgII1pFTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z0dTyJxaaBCvj2aFqsp0X60XnIYkW/yWGB3gPIINVR9heWMLmyaNyT5o750agH9Sg vPu3VimZUf0n1i0ztSMeGFhxDFF9AjS08+ucWv2fTXmsfequDOITTcBzfSUWt+q5/7 G5iudbuipNeKgXlmC9/P6c2vnYEE20Fb0OhPBhKI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Daniel Vetter , Sasha Levin Subject: [PATCH 4.14 065/242] drm/gma500: fix double free of gma_connector Date: Mon, 28 Dec 2020 13:47:50 +0100 Message-Id: <20201228124907.886151754@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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: Tom Rix [ Upstream commit 4e19d51ca5b28a1d435a844c7b2a8e1b1b6fa237 ] clang static analysis reports this problem: cdv_intel_dp.c:2101:2: warning: Attempt to free released memory kfree(gma_connector); ^~~~~~~~~~~~~~~~~~~~ In cdv_intel_dp_init() when the call to cdv_intel_edp_panel_vdd_off() fails, the handler calls cdv_intel_dp_destroy(connector) which does the first free of gma_connector. So adjust the goto label and skip the second free. Fixes: d112a8163f83 ("gma500/cdv: Add eDP support") Signed-off-by: Tom Rix Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20201003193928.18869-1-trix@redhat.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index 7ec4e3fbafd8c..ec6ea202cf5de 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -2126,7 +2126,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev DRM_INFO("failed to retrieve link info, disabling eDP\n"); cdv_intel_dp_encoder_destroy(encoder); cdv_intel_dp_destroy(connector); - goto err_priv; + goto err_connector; } else { DRM_DEBUG_KMS("DPCD: Rev=%x LN_Rate=%x LN_CNT=%x LN_DOWNSP=%x\n", intel_dp->dpcd[0], intel_dp->dpcd[1], -- 2.27.0