Message ID | 11957c20-b178-4027-9b0a-e32e9591dd7c@moroto.mountain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-39784-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp540050dyb; Fri, 26 Jan 2024 01:22:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0wHl/js1Fx1/wc7Dsfu+/2C76g6M09R4Lqj7VJ/SbM+liAxSHseCI0JLOn8OkVY1jF4qH X-Received: by 2002:a05:620a:214e:b0:783:80e6:1c00 with SMTP id m14-20020a05620a214e00b0078380e61c00mr1138230qkm.123.1706260975246; Fri, 26 Jan 2024 01:22:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706260975; cv=pass; d=google.com; s=arc-20160816; b=PqDEFBbcETmdRlhCacX0INjXCy/ntq2iyC0AcfaTwNAIAoMmaqYr7ZbogfSb4qZoG2 FGtf8uyKyfoPn5Mb9/hOkZOXg2aVEHpSfjizivAFoRUr+qwfEFwTMD6dfl+EQeUPZ38c qMR1oVZgJQubduWg1mLkk43v2ZJLeyweX5pt042ts2X9eyexXfGim5oKCs96awRyuywu sd2mgbG5z/BMtz9Rd9Vuz8xXR6MCituWLgL4N8tj7uLTk8zdZQxz8eOp+3oRgXIUEuSX 9HiG9tg80pfQ7wxMM3N4hi5NrbDPNv0MJdOQIF24nf4weM6s7igRup0Tv7hM6NcD4lCL e4OQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=FHr39JH9ZAVO5s/Q6TxKvwEModPDg6RBhwecUYh/FLY=; fh=OnzOTusZGobhqfaP0goQYRcSXrk84cvu9O3NOBEAUmU=; b=pER5xLnVI5nMGVok1XZ7+aGXGf88plOf/ebG7g8f031hAFZ5sSLz0VgoiyLwft7JMU SbHEJb3dNjgr5GC577TkvKKMk7SlJjHTEW4wD8XgNdDnWCUNpYQEpf9JiPbDtyYWD8sC 81hBFrBP3EoQBd8l9mZeSqE3Pl31GAH8tLz25XQDOfBrZxMbgPD9txh/hG3HZSMSrIS/ SUvlahIHTzrKh9wMdFBBjE4Rke44UeltCURMy4PoRff9xnZXnl4KMv2cqNaPHpzaRJ5A tr6DBfT+sdD5rxRZRdLdGhV+oSB82uqzmVYhQs+Xm7ljudfQFYxkNkKd3kw4TLoqFBWt AkUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Wg3/9hFa"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-39784-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39784-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g21-20020ae9e115000000b00783daaec208si123025qkm.17.2024.01.26.01.22.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 01:22:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39784-ouuuleilei=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=@linaro.org header.s=google header.b="Wg3/9hFa"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-39784-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39784-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 0DAEF1C2490C for <ouuuleilei@gmail.com>; Fri, 26 Jan 2024 09:22:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A540A12BF3A; Fri, 26 Jan 2024 08:41:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Wg3/9hFa" Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 53F0D1C29E for <linux-kernel@vger.kernel.org>; Fri, 26 Jan 2024 08:41:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706258514; cv=none; b=c39l4GTptmlNKCYlDFTxhaqcSf9s6XYHF3dwZV1c+6PFtl5wPbZXn9MR3Jpa6w/9u+eBJei4/pnBPKwqVew42yRZ2Fp7t9QzoaketPoo8L5p7KeCDSH/+gh3aol2UKOF7BOo4v2dBN+Z7lyQ4Em1wSbAxon7tYwkclS6K/Y9zT8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706258514; c=relaxed/simple; bh=JnrnAWx1YmbnGWJzTzQmFlWxZHRMFnM3TZP+A72q7YU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=hOApbdvKe0OwLw6wOJdDf6C2yqw1hansSzfSmk1WGGT1xZX0EELDDQ+HZGHAIOrmsjZjz+Wr3xD4++FM7f5YTVZOMx4PYMpe32Nhdjdc1jgcMCbZiglJq7Emz9Ur+oVZa8JF603l4oNaHzz2PLuvgGM2OSgJQnA9sqN9drsVdN0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Wg3/9hFa; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-33934567777so143647f8f.1 for <linux-kernel@vger.kernel.org>; Fri, 26 Jan 2024 00:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706258510; x=1706863310; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=FHr39JH9ZAVO5s/Q6TxKvwEModPDg6RBhwecUYh/FLY=; b=Wg3/9hFaDCkdLyUec5JYl42eDyJad/ZiNHFB+I7Y33tpOvgYOyHN9JxjmzhTFYPX8z buimo5055u2Jkv+7S/U1IGgUg69HI3TJhwQYoy/2QVqdLEblr1ptLZKQeOGexnvm815J ddzgveqQDdp6TLre3Ffg27G16/aNGOgNtNu+azXpqhonhvJO3eFhM5IUR/JD7a/6lXpA ReuOlTqY+N5zc2rHe8rzaCHQTRRMHOH4lvECbY/MGQ6CA1B7uL6epECEbUAXwRsNY50c xcHz7/DfuBgJU0CWkzgXqhhhzHE4Y5osT530ZVylf1QTdAowQLyly3679d+EvBhZ+AZz Sc2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706258510; x=1706863310; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FHr39JH9ZAVO5s/Q6TxKvwEModPDg6RBhwecUYh/FLY=; b=dKIrdgP6/nMZ0wchRmyVeOOQXz9U9eR+NjjACywytXO6YahBSZLjJSn3YnSHsuJTdF ZPTbi0BbAHtlyirHZhXVmdVsdNOZDfLpboX6T+8vO8+VwlsWz7Tvt4OS9h8auwVaJZX9 7qk5EM9KXIvh5fRIJPUUaSf6BDLzCUVzw/M5+gEeilJku1AncYx9cQ/soOJn5nwKlwNw KxvwKZEgCL72Zf7xxlAumUpz3lv6gsjAKVX5kEs906yarQucl57WMyrTbjkJefed/3Yh qufX73FduyPFVU9SptjqR7HvXE4XMI71QlO1LqvjiRPFI6T5DVjID/qtCfPcs/34BWmp s9vw== X-Gm-Message-State: AOJu0YxC0wApNPvMc3+B88wGpPlhv/TNUnpLD3Yg2go958f5+1rBo3vE plCsmAq/EUeP0qnuTEA/HWL1uEQmDozZT4dHEl4gZs/cxX8m3njdBv/FgbeBqMY= X-Received: by 2002:adf:e852:0:b0:33a:ddff:7774 with SMTP id d18-20020adfe852000000b0033addff7774mr24330wrn.36.1706258510562; Fri, 26 Jan 2024 00:41:50 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id bt7-20020a056000080700b00337d4ce6ab4sm766097wrb.20.2024.01.26.00.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 00:41:50 -0800 (PST) Date: Fri, 26 Jan 2024 11:41:47 +0300 From: Dan Carpenter <dan.carpenter@linaro.org> To: Zhi Wang <zhi.a.wang@intel.com> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>, Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, 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: [PATCH] drm/i915/gvt: Fix uninitialized variable in handle_mmio() Message-ID: <11957c20-b178-4027-9b0a-e32e9591dd7c@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789144308438188927 X-GMAIL-MSGID: 1789144308438188927 |
Series |
drm/i915/gvt: Fix uninitialized variable in handle_mmio()
|
|
Commit Message
Dan Carpenter
Jan. 26, 2024, 8:41 a.m. UTC
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.
Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/gpu/drm/i915/gvt/handlers.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
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. > > Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > drivers/gpu/drm/i915/gvt/handlers.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/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 = start; i < end; i += 4) { > p = 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); > > /* We return -EEXIST here to make GVT-g load fail. > * So duplicated MMIO can be found as soon as > -- > 2.43.0 > Thanks for the fix. Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/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 = start; i < end; i += 4) { p = 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); /* We return -EEXIST here to make GVT-g load fail. * So duplicated MMIO can be found as soon as