Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154323719
D6454.id16570.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6454.id16570.diff
View Options
Index: head/sys/kern/subr_taskqueue.c
===================================================================
--- head/sys/kern/subr_taskqueue.c
+++ head/sys/kern/subr_taskqueue.c
@@ -128,16 +128,17 @@
int mtxflags, const char *mtxname __unused)
{
struct taskqueue *queue;
- char *tq_name = NULL;
+ char *tq_name;
- if (name != NULL)
- tq_name = strndup(name, 32, M_TASKQUEUE);
- if (tq_name == NULL)
- tq_name = "taskqueue";
+ tq_name = malloc(TASKQUEUE_NAMELEN, M_TASKQUEUE, mflags | M_ZERO);
+ if (!tq_name)
+ return (NULL);
+
+ snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue");
queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO);
if (!queue)
- return NULL;
+ return (NULL);
STAILQ_INIT(&queue->tq_queue);
TAILQ_INIT(&queue->tq_active);
@@ -153,7 +154,7 @@
queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE;
mtx_init(&queue->tq_mutex, tq_name, NULL, mtxflags);
- return queue;
+ return (queue);
}
struct taskqueue *
Index: head/sys/sys/taskqueue.h
===================================================================
--- head/sys/sys/taskqueue.h
+++ head/sys/sys/taskqueue.h
@@ -56,6 +56,7 @@
#define TASKQUEUE_CALLBACK_TYPE_MIN TASKQUEUE_CALLBACK_TYPE_INIT
#define TASKQUEUE_CALLBACK_TYPE_MAX TASKQUEUE_CALLBACK_TYPE_SHUTDOWN
#define TASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX + 1
+#define TASKQUEUE_NAMELEN 32
typedef void (*taskqueue_callback_fn)(void *context);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 28, 8:31 PM (3 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32304063
Default Alt Text
D6454.id16570.diff (1 KB)
Attached To
Mode
D6454: Adjust the creation of tq_name so it can be freed correctly
Attached
Detach File
Event Timeline
Log In to Comment