Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.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>,
	John Harrison <John.C.Harrison@Intel.com>,
	Alan Previn <alan.previn.teres.alexis@intel.com>,
	Michal Wajdeczko <michal.wajdeczko@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<intel-gfx@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Cc: error27@gmail.com, dan.carpenter@linaro.org
Subject: Re: [Intel-gfx] [PATCH next] drm/i915/huc: Fix missing error code in intel_huc_init()
Date: Wed, 14 Jun 2023 15:33:15 -0700	[thread overview]
Message-ID: <143b6ba1-4ea2-cd62-ceef-5acb263a2264@intel.com> (raw)
In-Reply-To: <20230614204109.3071989-1-harshit.m.mogalapalli@oracle.com>



On 6/14/2023 1:41 PM, Harshit Mogalapalli wrote:
> Smatch warns:
> 	drivers/gpu/drm/i915/gt/uc/intel_huc.c:388
> 	    intel_huc_init() warn: missing error code 'err'
>
> When the allocation of VMAs fail: The value of err is zero at this
> point and it is passed to PTR_ERR and also finally returning zero which
> is success instead of failure.
>
> Fix this by adding the missing error code when VMA allocation fails.
>
> Fixes: 08872cb13a71 ("drm/i915/mtl/huc: auth HuC via GSC")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>

Thanks for the fix.

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

It looks like the patch wasn't picked out by our CI, so I'm going to 
re-send it to intel-gfx for testing and then merge it via drm-intel once 
we get the results.

Daniele

> ---
> Found using Static analysis with Smatch, only compile tested.
> ---
>   drivers/gpu/drm/i915/gt/uc/intel_huc.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> index e0afd8f89502..ddd146265beb 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> @@ -384,6 +384,7 @@ int intel_huc_init(struct intel_huc *huc)
>   
>   		vma = intel_guc_allocate_vma(&gt->uc.guc, PXP43_HUC_AUTH_INOUT_SIZE * 2);
>   		if (IS_ERR(vma)) {
> +			err = PTR_ERR(vma);
>   			huc_info(huc, "Failed to allocate heci pkt\n");
>   			goto out;
>   		}


  reply	other threads:[~2023-06-14 22:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 20:41 [Intel-gfx] [PATCH next] drm/i915/huc: Fix missing error code in intel_huc_init() Harshit Mogalapalli
2023-06-14 22:33 ` Ceraolo Spurio, Daniele [this message]
2023-06-21  3:49 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/huc: Fix missing error code in intel_huc_init() (rev2) Patchwork
2023-06-21  4:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-06-21 14:32 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=143b6ba1-4ea2-cd62-ceef-5acb263a2264@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=John.C.Harrison@Intel.com \
    --cc=airlied@gmail.com \
    --cc=alan.previn.teres.alexis@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox