From nobody Fri Nov 29 04:53:39 2024 Received: from MSK-MAILEDGE.securitycode.ru (msk-mailedge.securitycode.ru [195.133.217.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7E031A270; Tue, 24 Sep 2024 11:20:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.133.217.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727176858; cv=none; b=p2ibdU5EHJQImgNyGN5CX9J6b6Dpptiafk7Mxl2aD42pzZvqN9NpJf98idp/ePRz6l6beXxyCw2nR37ZPMLqvVQ6lSvxyveFgCwEUnmHD8q1NuGbywN5mp0K7doxvlPN21xQMnA3evBP7lLCOSKU9qLsOr9QmRSy8GqaA0WL2Jw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727176858; c=relaxed/simple; bh=8digug/2eny5eemeKKr826HxeviLtUFg+wRijkLLm4g=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DlJtoUTkhhI6HcWJDaHYE3ibBvxnKYmoQ5bAU2BxoWILiy7rrEy4C8oxsjgUQHyuB6Q11EOx0f61hgBjxqvHr5z7CYCXQ4jWt2/1WPAESiuKa03YWSo+uy8Kr6A7Xrx9NFLfyIcixuJ8Iz4HNbEgPf3hOZmLIOmNBx8F9Sb2cCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=securitycode.ru; spf=pass smtp.mailfrom=securitycode.ru; arc=none smtp.client-ip=195.133.217.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=securitycode.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=securitycode.ru From: George Rurikov To: Jani Nikula CC: George Rurikov , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , David Airlie , Simona Vetter , , , , , Subject: [PATCH] drm: Add check for encoder in intel_get_crtc_new_encoder() Date: Tue, 24 Sep 2024 14:20:23 +0300 Message-ID: <20240924112023.1071395-1-g.ryurikov@securitycode.ru> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-ClientProxiedBy: SPB-EX2.Securitycode.ru (172.16.24.92) To MSK-EX2.Securitycode.ru (172.17.8.92) If the video card driver could not find the connector assigned to the current video controller, or if the hardware status has changed so that a pre-existing connector is no longer active, none of the state connectors will meet the assignment criteria for the current crtc video controller. In the drm_WARN function, encoder->base.dev is called, so '&encoder->base.dev' will be dereferenced since encoder will still be initialized NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: e12d6218fda2 ("drm/i915: Reduce bigjoiner special casing") Cc: stable@vger.kernel.org Signed-off-by: George Rurikov --- drivers/gpu/drm/i915/display/intel_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm= /i915/display/intel_display.c index b4ef4d59da1a..1f25b12e5f67 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -819,9 +819,11 @@ intel_get_crtc_new_encoder(const struct intel_atomic_s= tate *state, num_encoders++; } - drm_WARN(state->base.dev, num_encoders !=3D 1, + if (encoder) { + drm_WARN(state->base.dev, num_encoders !=3D 1, "%d encoders for pipe %c\n", num_encoders, pipe_name(primary_crtc->pipe)); + } return encoder; } -- 2.34.1 =D0=97=D0=B0=D1=8F=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5 =D0=BE =D0=BA=D0=BE= =D0=BD=D1=84=D0=B8=D0=B4=D0=B5=D0=BD=D1=86=D0=B8=D0=B0=D0=BB=D1=8C=D0=B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