From: Dan Carpenter <dan.carpenter@oracle.com>
To: Arunpravin.PaneerSelvam@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: [bug report] drm/ttm: Fix dummy res NULL ptr deref bug
Date: Thu, 11 Aug 2022 12:55:27 +0300 [thread overview]
Message-ID: <YvTSD44z0csJ8YsP@kili> (raw)
Hello Arunpravin Paneer Selvam,
This is a semi-automatic email about new static checker warnings.
The patch cf4b7387c0a8: "drm/ttm: Fix dummy res NULL ptr deref bug"
from Aug 9, 2022, leads to the following Smatch complaint:
drivers/gpu/drm/ttm/ttm_bo.c:915 ttm_bo_validate()
warn: variable dereferenced before check 'bo->resource' (see line 907)
drivers/gpu/drm/ttm/ttm_bo.c
906 */
907 if (!ttm_resource_compat(bo->resource, placement)) {
^^^^^^^^^^^^
Unchecked dereference here inside the function.
908 ret = ttm_bo_move_buffer(bo, placement, ctx);
909 if (ret)
910 return ret;
911 }
912 /*
913 * We might need to add a TTM.
914 */
915 if (!bo->resource || bo->resource->mem_type == TTM_PL_SYSTEM) {
^^^^^^^^^^^^
Checked too late.
This NULL check was added deliberately based on a report from the kbuild
bot, but it's not clear why bo->resource is NULL at this point. Was the
patch tested? There is a stable@vger.kernel.org but there is no Fixes
tag.
916 ret = ttm_tt_create(bo, true);
917 if (ret)
regards,
dan carpenter
next reply other threads:[~2022-08-11 9:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 9:55 Dan Carpenter [this message]
2022-08-11 11:06 ` [bug report] drm/ttm: Fix dummy res NULL ptr deref bug Arunpravin Paneer Selvam
2022-08-11 11:56 ` Dan Carpenter
2022-08-14 6:00 ` Arunpravin Paneer Selvam
2022-08-14 17:50 ` Christian König
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=YvTSD44z0csJ8YsP@kili \
--to=dan.carpenter@oracle.com \
--cc=Arunpravin.PaneerSelvam@amd.com \
--cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.