Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp203631rdb; Sun, 28 Jan 2024 22:05:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFU5qaKVtuxf0sX2JEN7aEUeRGX78+KWW3bxMW1qm1yDxo5ofCh8Z7cVGbT7W3VZNknOHL3 X-Received: by 2002:ac8:7fd0:0:b0:42a:2ec3:a76f with SMTP id b16-20020ac87fd0000000b0042a2ec3a76fmr6203972qtk.127.1706508309627; Sun, 28 Jan 2024 22:05:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706508309; cv=pass; d=google.com; s=arc-20160816; b=BDo1LPyqNnBOa0qll7uekBRNDbq4WahfAItLTJcJuktXO5GZFA+ROPXoWxB/gz91F5 vNDUlwEUGtGfDOSf/yk3UB7iWsy33BERd6DTtNuZDiUAuxNDC1pX76x/WNGv3Z3MPQMQ AQGgOBo3gbWhnR7SEF8Xj2WRIXw9GiS+ABfk86NSJnfs/KHI9mmv37CGNd8DsZHdqhJo f7y6pbDke9Aym+jsuiBkmU2amyxs46LeQza2Bm0pSzMgLnIYmqYBs3iXI0L2heGtvSfn 1M8VGTeWRJRiHnvlYACvD5cTx89mO43iy5mxIp1Nj3drNLaucoRT53ERzx9mMol8wYVR B64A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=qGOdJc55hSAa3vK+bLuCB3qam7mxbxYsKHrJqixYHAg=; fh=csm4Ltct8Eu5qg6+v4/NNgu2yKLEYvn7cHNxiwgswDg=; b=IdeE8LLGfMAUJFJR9Z4T4s0Ufr8WT1y7Vfa6ck53cCLs4Juea4a8uHsLw7eRiu9AzI q0iiyBzDNYAfIvJWRDBAl4PChWXQil6aSzYPqnaAyH4nb/L5W+yFCH8qF2lshwdQzw9O Evjzs3Ny8FuvmR0e3DPoEUga4TePchp//LteuVqwZV0ynO3zbCNYkTTvM0b+a6hDWjMb T6eN8utjZQSLvQMW0/gj2e2Tz0BoTPOQURMZd6rGOBjpfZX8kTsE/meRcqTEqN8hACR7 eQwA3rcjfEJH47pr6QCUgNoK3r4FF3cwkNp/4flGgV58GZ8g7pUy5BNFVooxylqbAr2Y Z5gQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hz5p9NOd; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a8-20020a05622a064800b00429c7bfc4b2si6766380qtb.392.2024.01.28.22.05.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 22:05:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hz5p9NOd; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D14A11C21A66 for ; Mon, 29 Jan 2024 03:36:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BBCE10A03; Mon, 29 Jan 2024 03:36:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hz5p9NOd" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 A1C78F9E0; Mon, 29 Jan 2024 03:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706499389; cv=none; b=j6kd8mCC3lKNysyvqaKpAuW13a5KqaoIUZXulXbhlPpKSfSlJl4CtvbYjbN3NptpOqByk9/Tntk3CDxld8ibaoG/tqtEeUiQuto+L87rmVcTT3Fv3oGWZixbtuVTO9Bba2DnX0+O6TLVFac50cEhVlV+I1NkQSaYQ5TOTLcGBJo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706499389; c=relaxed/simple; bh=DTK+Uv/HINzvJpySwWLfjp2M9gYLySqkKhOfo+5AGpI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mxjC2TL+BVb+2H6AHo2gjM+hrb8lQu5z0fdX5W/98aELxF+N2eeCsmK8rBoZ2oTh3/9QfsvYQjiC2/qWV8RBmt9NeGaq9hO4KMOaWoIai7QBF5SslaIYljXKjWfCZtFoGc8pSdjlxaMZtqQ1HJHUtLNhTpMgeDzkj1/JFy0h4jQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hz5p9NOd; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706499387; x=1738035387; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=DTK+Uv/HINzvJpySwWLfjp2M9gYLySqkKhOfo+5AGpI=; b=hz5p9NOdza5VM0skTy65E+sqBFhG6PrO24ISS6TNmo1x0s8hk9Jke+WX kXoFbY93c66f0BEFwxVDJaaTkGPaymlQpjuDJnIrCfI6K+XkKxD0uMEO9 4oaQFV5+ZmrZdc9YIn9rA6ZnwiQYxKNJ0WehC9B5WF+a1i4VBsGQDnwhS 8L9J8g4YEXAzHuRgqu5kxcV2NcRXDfC9g94ndEqOGF8dQwtvJwz47/g65 2bmpZuzet5I/JuPnh+xJFEKiv7CioUS9WYOBoatXcQvmx99GnnGW0Moyr 6reOedTibMG91vIv9EIMjC+vMYXLFLfcn9KmgeE+GBT75izjOoq/zRmq6 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="9952025" X-IronPort-AV: E=Sophos;i="6.05,226,1701158400"; d="asc'?scan'208";a="9952025" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2024 19:36:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="737252624" X-IronPort-AV: E=Sophos;i="6.05,226,1701158400"; d="asc'?scan'208";a="737252624" Received: from debian-skl.sh.intel.com (HELO debian-skl) ([10.239.160.45]) by orsmga003.jf.intel.com with ESMTP; 28 Jan 2024 19:36:23 -0800 Date: Mon, 29 Jan 2024 11:37:12 +0800 From: Zhenyu Wang To: Dan Carpenter Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] drm/i915/gvt: Fix uninitialized variable in handle_mmio() Message-ID: Reply-To: Zhenyu Wang References: <11957c20-b178-4027-9b0a-e32e9591dd7c@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fFznBIJrCBlpQLxV" Content-Disposition: inline In-Reply-To: <11957c20-b178-4027-9b0a-e32e9591dd7c@moroto.mountain> --fFznBIJrCBlpQLxV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024.01.26 11:41:47 +0300, Dan Carpenter wrote: > This code prints the wrong variable in the warning message. It should > print "i" instead of "info->offset". On the first iteration "info" is > uninitialized leading to a crash and on subsequent iterations it prints > the previous offset instead of the current one. >=20 > Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT= -g") > Signed-off-by: Dan Carpenter > --- > drivers/gpu/drm/i915/gvt/handlers.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/g= vt/handlers.c > index 90f6c1ece57d..efcb00472be2 100644 > --- a/drivers/gpu/drm/i915/gvt/handlers.c > +++ b/drivers/gpu/drm/i915/gvt/handlers.c > @@ -2849,8 +2849,7 @@ static int handle_mmio(struct intel_gvt_mmio_table_= iter *iter, u32 offset, > for (i =3D start; i < end; i +=3D 4) { > p =3D intel_gvt_find_mmio_info(gvt, i); > if (p) { > - WARN(1, "dup mmio definition offset %x\n", > - info->offset); > + WARN(1, "dup mmio definition offset %x\n", i); > =20 > /* We return -EEXIST here to make GVT-g load fail. > * So duplicated MMIO can be found as soon as > --=20 > 2.43.0 > Thanks for the fix. Reviewed-by: Zhenyu Wang --fFznBIJrCBlpQLxV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCZbcdZAAKCRCxBBozTXgY J2ggAKCd25TTBDuQLbVH3Z0bjmgfKdx2/ACdGvx9Npm4P2p4XDkYtaiqEkyy4Zk= =/6Nx -----END PGP SIGNATURE----- --fFznBIJrCBlpQLxV--