Skip to content

[BUG] Error codes mixed up Cadence codec adapter code #5658

@lyakh

Description

@lyakh

Describe the bug
Multiple locations in cadence.c e.g. in cadence_codec_init() mix together error codes from different incompatible sets:

static int cadence_codec_init(struct processing_module *mod)

Expected behavior
Functions should return consistent error codes.

Impact
Error detection and interpretation becomes unreliable.

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology).

Screenshots or console output

int cadence_codec_init(struct comp_dev *dev)
{
	int ret;
	...
	cd = codec_allocate_memory(dev, sizeof(struct cadence_codec_data), 0);
	if (!cd) {
		comp_err(dev, "cadence_codec_init(): failed to allocate memory for cadence codec data");
		return -ENOMEM;
	}
	...
	/* Obtain codec name */
	API_CALL(cd, XA_API_CMD_GET_LIB_ID_STRINGS,
		 XA_CMD_TYPE_LIB_NAME, cd->name, ret);
	if (ret != LIB_NO_ERROR) {
		comp_err(dev, "cadence_codec_init() error %x: failed to get lib name",
			 ret);
		codec_free_memory(dev, cd);
		goto out;
	}
	...
out:
	return ret;
}

Metadata

Metadata

Assignees

Labels

P2Critical bugs or normal featuresbugSomething isn't working as expectedstaleIssue/PR marked as stale and will be closed after 14 days if there is no activity.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions