From: "Gustavo A. R. Silva" Subject: Re: [PATCH] drm/i915/selftests: Fix uninitialized variable Date: Tue, 24 Apr 2018 08:30:58 -0500 Message-ID: <09f02909-90cb-60f0-e362-7d5314dd8964@embeddedor.com> References: <20180424131545.GA4053@embeddedor.com> <152457614368.12387.9348969127399551440@mail.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <152457614368.12387.9348969127399551440@mail.alporthouse.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Chris Wilson , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org On 04/24/2018 08:22 AM, Chris Wilson wrote: > Quoting Gustavo A. R. Silva (2018-04-24 14:15:45) >> There is a potential execution path in which variable err is >> returned without being properly initialized previously. >> >> Fix this by initializing variable err to 0. > > err is only returned along an error path, returning 0 would not be > useful. Which path? All the error paths look correct to me. > -Chris > If the following two conditions take the false branch then the function returns err with a random stack value: if (intel_has_reset_engine(i915)) { ... } if (intel_has_gpu_reset(i915)) { ... } Thanks -- Gustavo