summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRasmus Villemoes <[email protected]>2024-05-21 10:46:50 +0200
committerStefan Roese <[email protected]>2024-06-16 12:13:38 +0200
commit3a11eada38efbbe1517662d196d11c2e20d2b5ca (patch)
tree76cd5910133c54834d15562e0addeda1cf969e02 /include
parent0786dd573d0793417852e009dee3148ebdd163f3 (diff)
cyclic: stop strdup'ing name in cyclic_register()
We are not checking the return value of strdup(), nor freeing the string in cyclic_unregister(). However, all current users either pass a string literal or the dev->name of the client device. So in all cases the name string will live at least as long as the cyclic_info is registered, so just make that a requirement. Reviewed-by: Stefan Roese <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/cyclic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/cyclic.h b/include/cyclic.h
index 44ad3cb6b80..38946216fb8 100644
--- a/include/cyclic.h
+++ b/include/cyclic.h
@@ -31,7 +31,7 @@
struct cyclic_info {
void (*func)(void *ctx);
void *ctx;
- char *name;
+ const char *name;
uint64_t delay_us;
uint64_t start_time_us;
uint64_t cpu_time_us;