Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2709403rdb; Mon, 12 Feb 2024 14:01:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWsJOAdo7MYBloxhwCGTMozs1us1j2VKVonH31Vg3USAWrZMR+fKVj9i+rbHYfcq+WhmC27X3n+Juu1BXK/JSddEFV6FCEtWeHV7DwsgA== X-Google-Smtp-Source: AGHT+IH57BfOMufGIYExwEPyp9BVxXZ6sthS0N+jU25g9OyCBdTZEPplkjqweuqnwWi9EdLCEMAY X-Received: by 2002:a05:6402:5d90:b0:561:9f62:8dba with SMTP id if16-20020a0564025d9000b005619f628dbamr3205810edb.12.1707775295177; Mon, 12 Feb 2024 14:01:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707775295; cv=pass; d=google.com; s=arc-20160816; b=TwF+gze4NR/zYqotf0E/YAmBl/Ch1haVSCOolRUpz1/X7unt/Yn23iJ1uMjaNYuHUj Xops0BCFYZyNsVEOHlX3a23mB3yd7vX/pIw8l2Siy9twfY2bjQT742HLEFlW5J1O3eNG t3pdPN0eqR/2gOcQPbzzwBqhGt2585my+Qb0ip1sYNJInlFDSDCVJhURvAUzhWJmksq0 vEcP0IvjNusOFcNWarO3hP/nSeZwWlQ9XxpxOhzLdSJsrDOLaFlYReSgL9z0VIoTGsz2 WAguhdnHH/QT3ffh5dfAO/izYHYZmb8cpImV8QnCo+vCD4GmSlZQ7D3IJAFUNPm8ieCk +hUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=s1tiZLAE0IY5F+3PoaTdN93+aFAoD71GK4lBVLpIcqk=; fh=7GMXzGM9LbQbvCovqNU0maW8pKuUJTE3tpLV9h75/oo=; b=WZRu4D0H2/Nr0SgcXm5EeNFol+16iTgBs5Wy18dd4TapHfM1MlmTelS98jErhKU0Pc frGNz4UKKtj94Lv2k01Jxt3GKhRmhBS3YzFezbhNNKVv+dZh0pfmxYtbk5SH/r6ZUnz/ MC4oa0sCep7hRpKAwUlzvHji/rx4rEDijPZ9ATYhZSuB4BzGIj8NdzT7NYP3GxOjL0Ws Uci3Vb7LhQs6R2UHfI2SB3h35Mgap3qlWPxxtcxcqJl9LqIPYBV0df6Jlb9SZpPe5e5T AMVGvGavXFMVu0S7QP/ndQUK12WP0MVfjxq7lJsoLMOh4VY+Nn3hoHK06fu6tnQNLowb Gz2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OZLVIC7P; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-62449-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCWP0dhyUKvovsd/Xmn4imSnc7HmY1okuRCYW8LMxxTnvZrSrMJXzaqQFYk8fHo432gvqBRRTXvX39FDoQKv8PyguyOWvrW+In7o89F+yg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cf6-20020a0564020b8600b00560339cc65csi3064182edb.169.2024.02.12.14.01.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 14:01:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62449-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OZLVIC7P; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-62449-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 68FE51F22689 for ; Mon, 12 Feb 2024 22:01:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 239CD4D10A; Mon, 12 Feb 2024 22:01:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OZLVIC7P" Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B156D4C63F for ; Mon, 12 Feb 2024 22:01:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707775275; cv=none; b=UlmgemVVVFO655MD0kOPsaBPtyr7V2pVocQJCc6EGSiD1mWRvfFsApUS9KiRGAHgBO3svIC3szWFy2pQe1d01aCoYlqqbWUW0xcEpfjrz5kfHYSgPUvf9tHCOESRMZF6lDQM1zAdSyzmxuIEu5LedvqQLt72LOWe9gnv4TFXJwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707775275; c=relaxed/simple; bh=dPMz7vBKt0af8txLL7Qg8jV1VWBfv65fKoz47kWElLs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=EE2d2M9k+O2JIgy5Moshc37zzz635+IfyM0x3FPn3Ih5QzX7c/K/Sl6AJ5BDyL8AcWGX408orzpZhMIVVXmUrV3KUb4zytrntZWm19O1AgNIdHQZSaXbMxni8GxHGWcPMGZKuAcziADeZr2WHti5ROGYael0W3PmDQJCINjMHww= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OZLVIC7P; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-55f0b2c79cdso5016286a12.3 for ; Mon, 12 Feb 2024 14:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707775272; x=1708380072; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=s1tiZLAE0IY5F+3PoaTdN93+aFAoD71GK4lBVLpIcqk=; b=OZLVIC7PyFp0hpQoc3wya9MZuSX/Hf3UsqfBNCV/J4hCKnvU2+a9J4wmy2CHspadO9 Md4G35n88g83ukLzFOBKF6sbkpwzODEam2KaLoM2pMoKUX0fz4a8qJF4SuCXbPfXGAQS mOdqMlSZ3MbOgKMeKXJp4oONBknc389vR0OtifLGmvZtItYeiZMDTZSt+9S+6xOSKhol 1h597kHiT/hYR76EU/BaBD6Tt6M5SectDop1o2u3kXXgtmTBXsv7QFLrjxSZ4lWk46XK o6dAUfEHGOx6cwyRT5XXjU2ymzaCkHk6oP2O7Oyjp/IkZ+pDPyIz4xEqj6lMOSv9vccM 4fOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707775272; x=1708380072; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s1tiZLAE0IY5F+3PoaTdN93+aFAoD71GK4lBVLpIcqk=; b=kpMebiWj79cZ1Jc11/D097BATc9TA8sYJGqBpf9QG0wo8FZJ283KEhd3JyjTVP34+h XbDVSafuNHXO7FeTf3tmOf3x6PD2hvP2EQ7bpvqqdBp5pUK5EXi6xfoPjf+DfUqZemND JA28NEJT/vsZJEYSt2/Yrzq2GZn1Iy/743KA8T8YbE7VQEiPxvvW9KXSIoM9WiZlt0uK 4t+54PMJtzDcb5fM+h0+hZb9lFJr5ozC4nwj1wE2IN/NjZDeSXhALeaxV2yRwUIBnsnz Vq3wRZl5aS8ETGpvbYwC6MiLETMbWPYV7MuLwI4Mau4OqzPttWuDKfEkbiSQ4T+HaSX/ L+IQ== X-Forwarded-Encrypted: i=1; AJvYcCW/6QW2hOON/LiU7gkuPVyXgne+HB/LSNrRqAKFh3H+26aP/EcS26W8IegfWh0G0mPu5i8xTX54LFpi37aqVZH0e1k5eyRgHeljYgIA X-Gm-Message-State: AOJu0YztNGMZCk4MuJ2nprYp2EGLeGpionB5FK/xjwVgwDyX25NHU9x2 QVNs/tQgsKdHqUV2GjwLNYTNfiZcI4M3P607VVuimK4beEfKvrfdKTlqfeyOQIfO52U+qK6dUqN 1oXu97W9RIZyH9XShYC0TjyirAYA= X-Received: by 2002:aa7:c992:0:b0:561:61ca:700e with SMTP id c18-20020aa7c992000000b0056161ca700emr5017791edt.6.1707775271950; Mon, 12 Feb 2024 14:01:11 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240212215534.190682-1-robdclark@gmail.com> In-Reply-To: <20240212215534.190682-1-robdclark@gmail.com> From: Rob Clark Date: Mon, 12 Feb 2024 14:00:59 -0800 Message-ID: Subject: Re: [PATCH] drm/crtc: fix uninitialized variable use even harder To: dri-devel@lists.freedesktop.org Cc: Rob Clark , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 12, 2024 at 1:55=E2=80=AFPM Rob Clark wro= te: > > From: Rob Clark > > DRM_MODESET_LOCK_ALL_BEGIN() has a hidden trap-door (aka retry loop), > which means we can't rely too much on variable initializers. > > Fixes: 6e455f5dcdd1 ("drm/crtc: fix uninitialized variable use") > Signed-off-by: Rob Clark > --- > I have mixed feelings about DRM_MODESET_LOCK_ALL_BEGIN() (and friends) > magic. On one hand it simplifies the deadlock/back dance. OTOH it > conceals a nasty sharp edge. Maybe it is better to have the complicated > restart path a bit more explicit, like it was originally. I should also point out, had drm-misc-next been using gitlab MRs and gitlab CI, we would have caught this ;-) BR, -R > drivers/gpu/drm/drm_crtc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > index cb90e70d85e8..65f9f66933bb 100644 > --- a/drivers/gpu/drm/drm_crtc.c > +++ b/drivers/gpu/drm/drm_crtc.c > @@ -904,6 +904,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *da= ta, > connector_set =3D NULL; > fb =3D NULL; > mode =3D NULL; > + num_connectors =3D 0; > > DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); > > -- > 2.43.0 >