Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/include/sof/tlv.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static inline void tlv_value_get(const void *data,
const struct sof_tlv *tlv = (const struct sof_tlv *)data;
const uint32_t end_addr = (uint32_t)data + size;

while ((uint32_t)tlv < end_addr) {
while (tlv && (uint32_t)tlv < end_addr) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abonislawski so if we hit tlv == NULL here the function will return with no error and the caller will assume, that it has succeeded...

if (tlv->type == type) {
*value = (void *)tlv->value;
*length = tlv->length;
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ int ipc4_find_dma_config_multiple(struct ipc_config_dai *dai, uint8_t *data_buff
struct ipc_dma_config *dma_cfg;
struct sof_tlv *tlvs;

for (tlvs = (struct sof_tlv *)data_buffer; (uint32_t)tlvs < end_addr;
for (tlvs = (struct sof_tlv *)data_buffer; tlvs && (uint32_t)tlvs < end_addr;
tlvs = tlv_next(tlvs)) {
dma_cfg = tlv_value_ptr_get(tlvs, GTW_DMA_CONFIG_ID);
if (!dma_cfg)
Expand Down
Loading