Skip to content

Should we consider goto-based error handling? #194

@haochengxia

Description

@haochengxia

Context: Our codebase uses a lot of malloc without error handling in pure C style.

One proposal: like the Linux kernel (e.g., mux.c)

    parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL);
    if (!parent_names)
        goto cleanup;

cleanup:
	kfree(parent_names);

Consider this when reviewing PR #184: Is it necessary at this stage?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions