diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-06-17 12:06:34 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-06-17 12:06:34 +0200 |
commit | 410df0c5748f6c5a53847d2acb163dc7cd8b6c51 (patch) | |
tree | 0c0f547f90a73ec6d30851f93720e0eb24f353eb /sound/soc/sof/control.c | |
parent | Documentation/atomic_t.txt: Clarify pure non-rmw usage (diff) | |
parent | Linux 5.2-rc5 (diff) | |
download | linux-410df0c5748f6c5a53847d2acb163dc7cd8b6c51.tar.xz linux-410df0c5748f6c5a53847d2acb163dc7cd8b6c51.zip |
Merge tag 'v5.2-rc5' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'sound/soc/sof/control.c')
-rw-r--r-- | sound/soc/sof/control.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c index 11762c4580f1..84e2cbfbbcbb 100644 --- a/sound/soc/sof/control.c +++ b/sound/soc/sof/control.c @@ -349,6 +349,7 @@ int snd_sof_bytes_put(struct snd_kcontrol *kcontrol, struct snd_sof_dev *sdev = scontrol->sdev; struct sof_ipc_ctrl_data *cdata = scontrol->control_data; struct sof_abi_hdr *data = cdata->data; + size_t size = data->size + sizeof(*data); int ret, err; if (be->max > sizeof(ucontrol->value.bytes.data)) { @@ -358,10 +359,10 @@ int snd_sof_bytes_put(struct snd_kcontrol *kcontrol, return -EINVAL; } - if (data->size > be->max) { + if (size > be->max) { dev_err_ratelimited(sdev->dev, - "error: size too big %d bytes max is %d\n", - data->size, be->max); + "error: size too big %zu bytes max is %d\n", + size, be->max); return -EINVAL; } @@ -375,7 +376,7 @@ int snd_sof_bytes_put(struct snd_kcontrol *kcontrol, } /* copy from kcontrol */ - memcpy(data, ucontrol->value.bytes.data, data->size); + memcpy(data, ucontrol->value.bytes.data, size); /* notify DSP of byte control updates */ snd_sof_ipc_set_get_comp_data(sdev->ipc, scontrol, |