diff options
| author | Rasmus Villemoes <[email protected]> | 2024-05-21 10:46:50 +0200 |
|---|---|---|
| committer | Stefan Roese <[email protected]> | 2024-06-16 12:13:38 +0200 |
| commit | 3a11eada38efbbe1517662d196d11c2e20d2b5ca (patch) | |
| tree | 76cd5910133c54834d15562e0addeda1cf969e02 /common/cyclic.c | |
| parent | 0786dd573d0793417852e009dee3148ebdd163f3 (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 'common/cyclic.c')
| -rw-r--r-- | common/cyclic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cyclic.c b/common/cyclic.c index a49bfc88f5c..c62e7fa7d19 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -40,7 +40,7 @@ struct cyclic_info *cyclic_register(cyclic_func_t func, uint64_t delay_us, /* Store values in struct */ cyclic->func = func; cyclic->ctx = ctx; - cyclic->name = strdup(name); + cyclic->name = name; cyclic->delay_us = delay_us; cyclic->start_time_us = timer_get_us(); hlist_add_head(&cyclic->list, cyclic_get_list()); |
