Skip to content

imx/gpt.c allocate_register_callback asserts instead of returning an error #50

Open
@bennoleslie

Description

@bennoleslie

In the allocate_register_callback function there is an assert:

    assert(curr_num == 0);

This does not seem appropriate. I'd suggest that this should return an error (in the same way that if ps_pmem_map fails an error is returned). The function has no reasonable basis on which to assert curr_num as the FDT contents are well outside the control. (By contrast the assertion assert(token != NULL) seems reasonable as this is controlled by the call to ps_fdt_walk_registers which is in the same module).

I'm not sure what the most appropriate return value would be, or what if this affects other areas as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions