Skip to content

Commit

Permalink
drm/i915/selftests: Fix uninitialized variable
Browse files Browse the repository at this point in the history
Static code analysis tool identified struct lrc_timestamp data as being
uninitialized and then data.ce[] is being checked for NULL/negative
value in the error path. Initializing data variable fixes the issue.

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200303142347.15696-1-aditya.swarup@intel.com
  • Loading branch information
Aditya Swarup authored and Chris Wilson committed Mar 3, 2020
1 parent 82126e5 commit 9b234d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gt/selftest_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4723,9 +4723,9 @@ static int __lrc_timestamp(const struct lrc_timestamp *arg, bool preempt)

static int live_lrc_timestamp(void *arg)
{
struct lrc_timestamp data = {};
struct intel_gt *gt = arg;
enum intel_engine_id id;
struct lrc_timestamp data;
const u32 poison[] = {
0,
S32_MAX,
Expand Down

0 comments on commit 9b234d2

Please sign in to comment.