From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31AC6C43464 for ; Fri, 18 Sep 2020 17:17:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DDF862311A for ; Fri, 18 Sep 2020 17:17:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDF862311A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 56F226ED3B; Fri, 18 Sep 2020 17:17:27 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1BA6F6ED3B for ; Fri, 18 Sep 2020 17:17:26 +0000 (UTC) IronPort-SDR: s1hDJK5VkSe13un//AQ3QnOasKkwluSn4UYUn0kjjSTyf6i4+EIgXlKnkmo16rmZBijr3OhgJI sAKqq3AwOIug== X-IronPort-AV: E=McAfee;i="6000,8403,9748"; a="147745909" X-IronPort-AV: E=Sophos;i="5.77,274,1596524400"; d="scan'208";a="147745909" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2020 10:17:24 -0700 IronPort-SDR: 9MUx7r+kfaBCCNVr9Ci3Ds4IQfu+OrYAamELCrdIeVJzQcOvWvtim0Rgdtgl+/n1b9GSAh6Hi+ UMIC6scsdCJg== X-IronPort-AV: E=Sophos;i="5.77,274,1596524400"; d="scan'208";a="452830235" Received: from rdvivi-losangeles.jf.intel.com (HELO intel.com) ([10.165.21.201]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2020 10:17:24 -0700 Date: Fri, 18 Sep 2020 13:19:40 -0400 From: Rodrigo Vivi To: Maarten Lankhorst Message-ID: <20200918171940.GC716636@intel.com> References: <20200918111208.1392128-1-maarten.lankhorst@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200918111208.1392128-1-maarten.lankhorst@linux.intel.com> Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix uninitialised variable in intel_context_create_request. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, Sep 18, 2020 at 01:12:08PM +0200, Maarten Lankhorst wrote: > In case backoff fails with an error, we return an undefined rq, > assign err to rq correctly. > > Fixes: 8a929c9eb1c2 ("drm/i915: Use ww pinning for intel_context_create_request()") > Signed-off-by: Maarten Lankhorst > --- > drivers/gpu/drm/i915/gt/intel_context.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c > index d301dda1b261..92a3f25c4006 100644 > --- a/drivers/gpu/drm/i915/gt/intel_context.c > +++ b/drivers/gpu/drm/i915/gt/intel_context.c > @@ -472,6 +472,7 @@ struct i915_request *intel_context_create_request(struct intel_context *ce) > err = i915_gem_ww_ctx_backoff(&ww); > if (!err) > goto retry; > + rq = ERR_PTR(err); The mix with "err" and rq handling both request and err is a bit confusing ihmo and prone to misses like this. I wonder if we also need this before the goto retry as well... but anyway it looks better than before with no rq assigment on this block... Reviewed-by: Rodrigo Vivi > } else { > rq = ERR_PTR(err); > } > > base-commit: 5887fa2d8b9b7f6a278f9a1bc8642cb9d5d0279a > -- > 2.28.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx