Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9193024pxu; Mon, 28 Dec 2020 08:56:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAi23+XWJbd2AkPwUzht/Bm3V1tohwsziokPbMYNVl0OH6KWM59dFQ3AI/0LRGKDR4bA3e X-Received: by 2002:a17:906:2e85:: with SMTP id o5mr41971766eji.521.1609174564469; Mon, 28 Dec 2020 08:56:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609174564; cv=none; d=google.com; s=arc-20160816; b=ticq7Cax+BpCbZbZNUfQxk0l3wIcptFsHPyoPgZpEmSg9pXQa2sW/JmLTf/Gw8tDoC 2f7js9cUa3o/wGHgvC5mf6C4FmcWcY/1AwTSjGg/qHfR2FX96p1aqHPSaEHk4fqyK7S3 9qd8PyrBORbfWmTh7mAwflMBI5KTXdISE0Gozk5MyiqQsLoilEZGj3wAMrbOl+ZBujZ9 iM8vPj3xUeR7DQTjEcwur5MSw1Hm03BHF877zKk0ush7h2GlgIYkZkxroyynrib99oBV DvlzNK9yRugDbr/oIa3oAD6NyaZJYa0bYX73Y+mPCJ781SUnmCoYT8vor6LeIkQ/cpnx bOTw== 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=VSP7sOL5Ofr3Vh/qHUvx2v1RCFripockszUjb9gXWJ4=; b=YlVXMChkOayxZRQ8rdXCGUihp8qWXIym+UoUX0SOYFliuETpApkAgr8aqYuZXnH+jT z/qRZv9geF96U8Be8OOX+vJB6HIzNBmf4oBlKRiCcSFBe7S442nZNKHfh0QhtCNShPYF VkAlEmCNBot1hAPCaaxlgxK91T0BmYCUwG7qTd1CSVAH9WrKJgvZ+Q7wdmJgZfxMH45b Rl55lz9KtRmO+b1iTaKf5BEfFY5UDQy0ezUvPZyAkFY2ZIRsUcHEAZjUNiEBvic83ezy O6O6ggDrYYOZ6mbdYeaW7UpW9EQO7aIIrrNvtuwZSP9/iL7k6DHGTgwnfTgPi1DAvasm ecUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bSZz5eJC; 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 r11si17661363edt.118.2020.12.28.08.55.38; Mon, 28 Dec 2020 08:56:04 -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=bSZz5eJC; 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 S1729055AbgL1QtW (ORCPT + 99 others); Mon, 28 Dec 2020 11:49:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:49800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728049AbgL1MxI (ORCPT ); Mon, 28 Dec 2020 07:53:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60E0622B45; Mon, 28 Dec 2020 12:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609159950; bh=3S7ORPcgh0u7YbAgO1rKmqlum0k39KZUXcXfuJPHr3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bSZz5eJCoc5/b0Y8sEUl9mUhgcYyDIqVS0dgqnfufaP/4cqCyDkcTqMljyOUcOTqV jbIapi2XfLP9Bj3HF1yzwg53hP+xnAHCRkdYeCSMmpY8UfsaDAwznEH4kj6Q7Dhkqg joB7cgxvvGPkKmfZ9xVWVmSOvZNvW9+0SZh5/Vf4= 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.4 032/132] drm/gma500: fix double free of gma_connector Date: Mon, 28 Dec 2020 13:48:36 +0100 Message-Id: <20201228124847.954698214@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124846.409999325@linuxfoundation.org> References: <20201228124846.409999325@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 25c68e4dc7a53..e465d71272584 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -2125,7 +2125,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