Repository navigation
ASoC: SOF: control: correct the copy size for bytes kcontrol put - #942
Conversation
plbossart
left a comment
There was a problem hiding this comment.
Good catch but fix needs an update, see below.
|
|
||
| /* copy from kcontrol */ | ||
| memcpy(data, ucontrol->value.bytes.data, data->size); | ||
| memcpy(data, ucontrol->value.bytes.data, data->size + sizeof(*data)); |
There was a problem hiding this comment.
this doesn't look fully correct, the test at line 361 should be updated as well to match what is done for get?
There was a problem hiding this comment.
@keyonjie this change seems OK.
But This API only supports up to 512 bytes max data size. We should be using the bytes_ext IO for all binary data. So I'd like to know what issue this change fixes.
There was a problem hiding this comment.
this doesn't look fully correct, the test at line 361 should be updated as well to match what is done for get?
Make sense, let me correct it.
There was a problem hiding this comment.
@keyonjie this change seems OK.
But This API only supports up to 512 bytes max data size. We should be using the bytes_ext IO for all binary data. So I'd like to know what issue this change fixes.
We are now using this API for test_detect component blob(smaller than 512, about 64 Bytes), we hit wrong bytes kcontrol put issue there.
You are correct, we will use bytes_ext for > 512B cases in other detector if needed.
The size for the bytes kcontrol should include the abi header, that is, data->size + sizeof(*data), it is also aligned with get method after this change. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
|
@ranj063 can you please help cherry-pick this to cros-sof-v4.14-rebase also? |
The size for the bytes kcontrol should include the abi header, that is,
data->size + sizeof(*data), it is also aligned with get method after
this change.
Signed-off-by: Keyon Jie yang.jie@linux.intel.com