Message ID | c8984fe2-dc1a-4ba8-97c9-5c83f53a0d09@moroto.mountain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-17828-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6183787dyb; Fri, 5 Jan 2024 04:22:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGv+RKQVLI1nCCSfmd4s3Qp/hdBmnUi1hmqgegMdInduMYgcbCUC+j2G5Yu+dxjO2DjS4oA X-Received: by 2002:a05:620a:2488:b0:77f:32c6:c6b8 with SMTP id i8-20020a05620a248800b0077f32c6c6b8mr2178128qkn.112.1704457367031; Fri, 05 Jan 2024 04:22:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704457367; cv=none; d=google.com; s=arc-20160816; b=B0ME9cOEKdWlcQH6V1gAlo85VmjEeH4ji/ZetTwCyZm4fNK7i4oKvcEkHysWV4byOz cqqDdEnaXOUsKgbjL6mXQ5GeRBKDJQLhajm/P6/EAMHFHq/Rn7Uay8tfiDp3GMMIFH0V cdlcM5hsSYpnUsKIqtfXDRoQFjDNSIlXcOM06G4v5pFmWM3jRRKcaISx00C1ftV5fl7s gdQAZyiwXx0zdyHXo7OblHBSfUWQGC8cAZrcOr16agsfouM/XEf6uDwV2lYJKWX2XZJ5 HWcGWwb/inMT7U5/hucxUIo3HiKkPjkxGn4Eg5bHhkWiTi5e74x8hzC+bZJQyGmXpuqY UYxQ== ARC-Message-Signature: i=1; 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=sGBscisyTSw/b2M1zSYK36n9y5Z4TnelnT//si07xms=; fh=/4BLuGwoxIBr2IdB1g9wZjQuT24YE5aqbl9UYJF9mGs=; b=cUCPqs/BTkIKdTfBexiT2WNcLwpitdQ5w9ioAycX7EEhh3x7sw6nIIqz1FhtOpxzO8 MwBZdpXEzIQz8eAbwHnCZTnM95zR3uWf61SktS3k6Xh5AnRLZYiJ51p48mc3l+W9c8N3 1ajeE1SCXSstny6TPR4b6TyoAO8/KZqI1LmMmS3bnElSTTXNPtd6zes0zv/Fcj7CFsIm I47gMik7OW94uskMVr3tIAOwGYhhfd3UBWK8U1QvAjtrib4xdBkDyeyNtdAgYpEEKCjD Ef8cIFH2mcNcL/arC6D+1rWEgydDjXgWMvUJejpvQoA42+HNR80IKJDNVy3wKnSPOgSE FC7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hrbIMxLS; spf=pass (google.com: domain of linux-kernel+bounces-17828-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17828-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dx8-20020a05620a608800b00781714576e9si1693352qkb.201.2024.01.05.04.22.46 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 04:22:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17828-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hrbIMxLS; spf=pass (google.com: domain of linux-kernel+bounces-17828-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17828-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 BE5A61C2180E for <ouuuleilei@gmail.com>; Fri, 5 Jan 2024 12:22:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0CB92D616; Fri, 5 Jan 2024 12:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hrbIMxLS" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 847DA2D040 for <linux-kernel@vger.kernel.org>; Fri, 5 Jan 2024 12:22:28 +0000 (UTC) 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-f42.google.com with SMTP id ffacd0b85a97d-336990fb8fbso1090009f8f.1 for <linux-kernel@vger.kernel.org>; Fri, 05 Jan 2024 04:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704457347; x=1705062147; 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=sGBscisyTSw/b2M1zSYK36n9y5Z4TnelnT//si07xms=; b=hrbIMxLSw8g63VsCT535qVeJOjRwMbf8ZGIMZ/q+LSLF4F7FdqpICyI/k+tMNnoDXH RwV9fAtVqE6I7S456kxIB9TDUqt1w2AmCqPUxP47CF+qLQ2OmwgMmHwvjqZxytIdpPsn 5TcKtSFXsnI/C7eS5sYmtHnIUyiyW88gGh8FZUpWzAxrjiMd4+hqoFc77CNFrTVPIbG2 Fq9dBFx8oqYbsu8UYSc+WG+/f9T3V/XQH1oFFfNKkUjVa4rTujbGKUvW6aEdnVUBjxzT J9AGO1xXYvk/hQk8hJb8eZwYxvEUkLDZ3QPFQRsF6LCh5dJHHe1SM/ktLlFDDSUbSPFU OYqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704457347; x=1705062147; 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=sGBscisyTSw/b2M1zSYK36n9y5Z4TnelnT//si07xms=; b=xLUf6SFBMojAIIqhTcKchS8tD/ivKm+oOZ9X4Fb7jh3k/R4Rl/RWju7tL7I9iBNddx dzP+pSSj/PQM7dPXAEIGITLHtDKc59R9wilfwLGYLcwwto7wY3rCO/PMLdvKsiLWJOTc 8B1sLUCh9Y+RvOAqTy47Q2gcWo3GtB85A6YDu22G1a37p2YQJSdEi7Mrr78TlquucoZ6 IM3nanLiTUfYKR7xJcMRYpXhE5XRC8mtZWjApH4i4kf7vDSXIPP9KVMYEgUk8a2REYfz 1JGjxwNbt46GgrFHHL0CnErEQlNyPT8pNDMS3MkWkA940hh3caIAOVJ+3XGcrOHJDU4Z hXrw== X-Gm-Message-State: AOJu0Yw6CpKtNGgUp6iP972fn6PvC+cBp/oAgN9VeTp1xKPL88Wnoe7z 1hD3wBqBd5V04MT7th3yvCPGGjkPlwUNpA== X-Received: by 2002:adf:ec05:0:b0:337:46ce:6239 with SMTP id x5-20020adfec05000000b0033746ce6239mr1113868wrn.60.1704457346718; Fri, 05 Jan 2024 04:22:26 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id d3-20020adffd83000000b003367e35abd4sm1296723wrr.71.2024.01.05.04.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 04:22:26 -0800 (PST) Date: Fri, 5 Jan 2024 15:22:23 +0300 From: Dan Carpenter <dan.carpenter@linaro.org> To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com>, Oded Gabbay <ogabbay@kernel.org>, Thomas =?iso-8859-1?q?Hellstr=F6m?= <thomas.hellstrom@linux.intel.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Matt Roper <matthew.d.roper@intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drm/xe/device: clean up on error in probe() Message-ID: <c8984fe2-dc1a-4ba8-97c9-5c83f53a0d09@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: 1787253088050629771 X-GMAIL-MSGID: 1787253088050629771 |
Series |
drm/xe/device: clean up on error in probe()
|
|
Commit Message
Dan Carpenter
Jan. 5, 2024, 12:22 p.m. UTC
This error path should clean up before returning.
Smatch detected this bug:
drivers/gpu/drm/xe/xe_device.c:487 xe_device_probe() warn: missing unwind goto?
Fixes: 4cb12b71923b ("drm/xe/xe2: Determine bios enablement for flat ccs on igfx")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
Speeking of static analysis, someone should probably run Sparse on this
driver. There are some missing annotations.
drivers/gpu/drm/xe/xe_mmio.h:65:72: warning: incorrect type in argument 1 (different address spaces)
drivers/gpu/drm/xe/xe_mmio.h:65:72: expected void const volatile [noderef] __iomem *addr
drivers/gpu/drm/xe/xe_mmio.h:65:72: got void *
drivers/gpu/drm/xe/xe_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Jan 05, 2024 at 03:22:23PM +0300, Dan Carpenter wrote: > This error path should clean up before returning. > > Smatch detected this bug: > drivers/gpu/drm/xe/xe_device.c:487 xe_device_probe() warn: missing unwind goto? > > Fixes: 4cb12b71923b ("drm/xe/xe2: Determine bios enablement for flat ccs on igfx") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Matthew Brost <matthew.brost@intel.com> > --- > Speeking of static analysis, someone should probably run Sparse on this > driver. There are some missing annotations. > > drivers/gpu/drm/xe/xe_mmio.h:65:72: warning: incorrect type in argument 1 (different address spaces) > drivers/gpu/drm/xe/xe_mmio.h:65:72: expected void const volatile [noderef] __iomem *addr > drivers/gpu/drm/xe/xe_mmio.h:65:72: got void * > > drivers/gpu/drm/xe/xe_device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c > index d9ae77fe7382..b8d8da546670 100644 > --- a/drivers/gpu/drm/xe/xe_device.c > +++ b/drivers/gpu/drm/xe/xe_device.c > @@ -484,7 +484,7 @@ int xe_device_probe(struct xe_device *xe) > > err = xe_device_set_has_flat_ccs(xe); > if (err) > - return err; > + goto err_irq_shutdown; > > err = xe_mmio_probe_vram(xe); > if (err) > -- > 2.42.0 >
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index d9ae77fe7382..b8d8da546670 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -484,7 +484,7 @@ int xe_device_probe(struct xe_device *xe) err = xe_device_set_has_flat_ccs(xe); if (err) - return err; + goto err_irq_shutdown; err = xe_mmio_probe_vram(xe); if (err)