All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: thomas.hellstrom@linux.intel.com
Cc: dri-devel@lists.freedesktop.org
Subject: [bug report] drm/ttm: Add a generic TTM memcpy move for page-based iomem
Date: Wed, 13 Apr 2022 14:11:26 +0300	[thread overview]
Message-ID: <20220413111126.GA20082@kili> (raw)

Hello Thomas Hellström,

The patch 3bf3710e3718: "drm/ttm: Add a generic TTM memcpy move for
page-based iomem" from Jun 2, 2021, leads to the following Smatch
static checker warning:

	./include/drm/ttm/ttm_bo_driver.h:259 ttm_bo_move_sync_cleanup()
	error: NULL dereference inside function 'ttm_bo_move_accel_cleanup()'

./include/drm/ttm/ttm_bo_driver.h
    256 static inline void ttm_bo_move_sync_cleanup(struct ttm_buffer_object *bo,
    257                                             struct ttm_resource *new_mem)
    258 {
--> 259         int ret = ttm_bo_move_accel_cleanup(bo, NULL, true, false, new_mem);
                                                        ^^^^
Passing a NULL for "fence" will crash.  The first place where it will
crash is in dma_resv_add_fence() where it does:

	WARN_ON(dma_fence_is_container(fence));

    260 
    261         WARN_ON(ret);
    262 }

regards,
dan carpenter

             reply	other threads:[~2022-04-13 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 11:11 Dan Carpenter [this message]
2022-04-13 11:42 ` [bug report] drm/ttm: Add a generic TTM memcpy move for page-based iomem Thomas Hellström

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=20220413111126.GA20082@kili \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /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.