AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: xinhui.pan-5C7GfCeVMHo@public.gmane.org
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)
Date: Wed, 20 Mar 2019 16:23:32 +0300	[thread overview]
Message-ID: <20190320132332.GA27053@kadam> (raw)

Hello xinhui pan,

This is a semi-automatic email about new static checker warnings.

The patch dbd249c24427: "drm/amdgpu: add amdgpu_ras.c to support ras 
(v2)" from Oct 31, 2018, leads to the following Smatch complaint:

    drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1215 amdgpu_ras_add_bad_pages()
    warn: variable dereferenced before check 'con' (see line 1211)

    drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1247 amdgpu_ras_reserve_bad_pages()
    warn: variable dereferenced before check 'con' (see line 1242)


drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
  1210		struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
  1211		struct ras_err_handler_data *data = con->eh_data;
                                                    ^^^^^^^^^^^^
Dereference

  1212		int i = pages;
  1213		int ret = 0;
  1214	
  1215		if (!con || !data || !bps || pages <= 0)
                    ^^^^
Check

  1216			return 0;
  1217	

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

             reply	other threads:[~2019-03-20 13:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 13:23 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-05-05  9:12 [bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2) Dan Carpenter
2020-05-05 12:37 ` Dan Carpenter
2020-05-06  7:26 ` Zhou1, Tao
2020-05-06  9:17   ` Dan Carpenter
2020-05-06 10:10     ` Pan, Xinhui
2020-05-06 11:33       ` Dan Carpenter

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=20190320132332.GA27053@kadam \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=xinhui.pan-5C7GfCeVMHo@public.gmane.org \
    /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