diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-08-29 11:13:09 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-08-29 11:13:09 +0200 |
| commit | 3e93d5bbcbfc3808f83712c0701f9d4c148cc8ed (patch) | |
| tree | 2f1ac64d01ba1938b12d6036fa7161340a9abded /kernel/params.c | |
| parent | 2cbe4ac193ed7172cfd825c0cc46ce4a41be4ba1 (diff) | |
| parent | 3e7fd1febc3156d3d98fba229399a13b12d69707 (diff) | |
Merge tag 'asoc-fix-v6.17-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.17
The main fixes here are for some of the cleanups done in the core in
this release, we had broken component lookup in the case with a single
bus and DMA controller. Otherwise it's driver specific changes, the
shortlogs for the Intel WCL and rsnd drivers look like minor cleanups
but are actually bugfixes (adding an op needed for correct functionality
and reverting an inappropriate helper usage).
Diffstat (limited to 'kernel/params.c')
| -rw-r--r-- | kernel/params.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/params.c b/kernel/params.c index b92d64161b75..b96cfd693c99 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -513,13 +513,14 @@ EXPORT_SYMBOL(param_array_ops); int param_set_copystring(const char *val, const struct kernel_param *kp) { const struct kparam_string *kps = kp->str; + const size_t len = strnlen(val, kps->maxlen); - if (strnlen(val, kps->maxlen) == kps->maxlen) { + if (len == kps->maxlen) { pr_err("%s: string doesn't fit in %u chars.\n", kp->name, kps->maxlen-1); return -ENOSPC; } - strcpy(kps->string, val); + memcpy(kps->string, val, len + 1); return 0; } EXPORT_SYMBOL(param_set_copystring); @@ -841,7 +842,7 @@ static void __init param_sysfs_builtin(void) dot = strchr(kp->name, '.'); if (!dot) { /* This happens for core_param() */ - strcpy(modname, "kernel"); + strscpy(modname, "kernel"); name_len = 0; } else { name_len = dot - kp->name + 1; |
