Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9185059pxu; Mon, 28 Dec 2020 08:42:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwE2WtPbQtkm06d6mvVAqlcKS10O3f79SlFfpIfQbwsxfLPDOAdV+3/sUoLrOSw7FcVQSmZ X-Received: by 2002:a17:907:9627:: with SMTP id gb39mr42949610ejc.267.1609173758357; Mon, 28 Dec 2020 08:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173758; cv=none; d=google.com; s=arc-20160816; b=XJttBKoAtSSqEzs/3b+IheBYyfDfBP+OUxa93i261iejWGUyZLLSQtiVZwWXrCjd1D QNlkHSy1s/3PIvVd4XxF+sSYgMUKglHg2w2xDz7DF3RSnp2q2FHdbJyil9nT0kfm3d28 KVnaXvTztcayia+mr2uvBDcDvooT5GF6fkQethkqj1XXaWpKnzJ/3xjTcCYXYFgBt4x9 iEQjxVhG2Nt2U/7cHioKAavYVo+4gdbVV/JOrnozg7aNfw4diYeDOgpIufQAjC7pOwer mPrGCc6zBi/x5BtayX7JQB3iHfVOkYwMeMGwA5T0dFwcztI26o6Lk1fLlcCB849iNacs pl+Q== 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=mWtQvN24RiDFBwLKvyM8pqkiQM0/JbbL39AqeSV8EygDRiLqa6iTS4gcR+6DUc48H0 gc+7qVJmWK6dDTqhtHs6t7DseGNny0OKVUgenNTpbs2i09GkEchbNzcDOTSjEwZzxHUb hNJ3FXtWZe4CXz8bz1giZldFpiwOvX14nuSGShDBbgVACD+c2P49GHAorwUP/z9S9R1E 10U/uJmSDQAhhmTtubDUMnuZ4iy9SMNogkXpyfImAtqC52bSbtSCBIGRzQ6GOnpt8Mno Qlm3STaWr746yMKtI1rw+KO/DYnofCb5aq73sISdQFxsrIrob3goI4b7rD86ijo38zh3 VMdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="uCyGQNT/"; 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 a17si18814280ejy.317.2020.12.28.08.42.13; Mon, 28 Dec 2020 08:42:38 -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="uCyGQNT/"; 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 S2633737AbgL1Qib (ORCPT + 99 others); Mon, 28 Dec 2020 11:38:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:57636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729762AbgL1NBT (ORCPT ); Mon, 28 Dec 2020 08:01:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A95E22AAA; Mon, 28 Dec 2020 13:00:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160438; bh=UM07LVbFrKGNSwO8zjsZD2hQhntSihKDIJTgII1pFTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uCyGQNT/njFZH3Hdm9UJohkamN2bBpMQiJ0hzG9Abb4q6NrVLUi5RwPKCzyPK+5Z2 OdslfQ4jBFth4vAlA1lUO3NW6sXcO4C8UpsmV50+CLQGz4YLDOY4Bn8fDK0nH69vYl kCEueALfLMdc2V4a6ipgtIklOvB/jND1r7qsoq8M= 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.9 050/175] drm/gma500: fix double free of gma_connector Date: Mon, 28 Dec 2020 13:48:23 +0100 Message-Id: <20201228124855.682996197@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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