From: David Herrmann <dh.herrmann@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 3/3] drm: simplify master cleanup
Date: Mon, 4 May 2015 16:05:14 +0200 [thread overview]
Message-ID: <1430748314-862-3-git-send-email-dh.herrmann@gmail.com> (raw)
In-Reply-To: <1430748314-862-1-git-send-email-dh.herrmann@gmail.com>
In drm_master_destroy() we _free_ the master object. There is no reason to
hold any locks while dropping its static members, nor do we have to reset
it to 0.
Furthermore, kfree() already does NULL checks, so call it directly on
master->unique and drop the redundant reset-code.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
drivers/gpu/drm/drm_drv.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 88b594c..3b3c4f5 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -132,15 +132,10 @@ static void drm_master_destroy(struct kref *kref)
r_list = NULL;
}
}
-
- if (master->unique) {
- kfree(master->unique);
- master->unique = NULL;
- master->unique_len = 0;
- }
mutex_unlock(&dev->struct_mutex);
idr_destroy(&master->magic_map);
+ kfree(master->unique);
kfree(master);
}
--
2.3.7
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-05-04 14:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 14:05 [PATCH 1/3] drm: drop unused 'magicfree' list David Herrmann
2015-05-04 14:05 ` [PATCH 2/3] drm: simplify authentication management David Herrmann
2015-05-04 14:46 ` Chris Wilson
2015-05-04 15:02 ` David Herrmann
2015-05-04 15:11 ` Chris Wilson
2015-05-04 15:14 ` David Herrmann
2015-05-04 15:25 ` Chris Wilson
2015-05-04 16:28 ` David Herrmann
2015-05-04 16:49 ` Chris Wilson
2015-05-04 18:21 ` David Herrmann
2015-05-04 18:19 ` [PATCH v2 " David Herrmann
2015-05-04 18:33 ` Chris Wilson
2015-05-04 18:37 ` David Herrmann
2015-05-04 19:01 ` [PATCH v3 " David Herrmann
2015-05-04 14:05 ` David Herrmann [this message]
2015-05-04 14:47 ` [PATCH 3/3] drm: simplify master cleanup Chris Wilson
2015-05-05 7:47 ` Daniel Vetter
2015-05-04 14:33 ` [PATCH 1/3] drm: drop unused 'magicfree' list Chris Wilson
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=1430748314-862-3-git-send-email-dh.herrmann@gmail.com \
--to=dh.herrmann@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--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.