From: Colin King <colin.king@canonical.com>
To: Christian Koenig <christian.koenig@amd.com>,
Roger He <Hongbo.He@amd.com>, David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drm/ttm: fix double lock on glob->lru_lock
Date: Fri, 22 Dec 2017 18:03:36 +0000 [thread overview]
Message-ID: <20171222180336.4250-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
Lock glob->lru_lock is locked before the while loop and also
locked again at the end of the while loop; it appears that the
lock at the end of the while loop is a double lock that should
be removed. CoverityScan picked this up with the introduction
of the referenced commit inthe Fixes tag, however, it may have
existed before this. I've not been able to test this, but it
does look incorrect to me.
Detected by CoverityScan, CID#1268846 ("Double lock")
Fixes: 827ed2b06b05 ("drm/ttm: use try_lock in ttm_bo_delayed_delete again")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/ttm/ttm_bo.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 60bb5c12b568..fb8d13a4bc94 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -595,7 +595,6 @@ static bool ttm_bo_delayed_delete(struct ttm_bo_device *bdev, bool remove_all)
}
kref_put(&bo->list_kref, ttm_bo_release_list);
- spin_lock(&glob->lru_lock);
}
list_splice_tail(&removed, &bdev->ddestroy);
empty = list_empty(&bdev->ddestroy);
--
2.14.1
next reply other threads:[~2017-12-22 18:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 18:03 Colin King [this message]
2017-12-22 18:58 ` 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=20171222180336.4250-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=Hongbo.He@amd.com \
--cc=airlied@linux.ie \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®