Skip to content

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

Closed as not planned

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;
}

Activity

  1. added
    bugSomething isn't working as expected
    on Apr 7, 2022
  2. self-assigned this
    on Apr 7, 2022
  3. dbaluta commented on Apr 7, 2022

    @dbaluta
    Collaborator
  4. added this to the v2.2 milestone on Apr 7, 2022
  5. added
    P2Critical bugs or normal features
    on Apr 12, 2022
  6. modified the milestones: v2.2, v2.6 on Feb 17, 2023
  7. modified the milestones: v2.6, TBD on May 10, 2023
  8. github-actions commented on Jun 19, 2025

    @github-actions

    This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

  9. added
    staleIssue/PR marked as stale and will be closed after 14 days if there is no activity.
    on Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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