Skip to content

free partial operator on alloc failure in create paths#10542

Merged
copybara-service[bot] merged 1 commit into
google:masterfrom
aizu-m:free-partial-op-on-alloc-failure
Jun 22, 2026
Merged

free partial operator on alloc failure in create paths#10542
copybara-service[bot] merged 1 commit into
google:masterfrom
aizu-m:free-partial-op-on-alloc-failure

Conversation

@aizu-m

@aizu-m aizu-m commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

spotted while tracing the create error paths against xnn_delete_operator: in xnn_create_resize_bilinear2d_nhwc, xnn_create_unary_elementwise_nc, create_unary_elementwise_nc, xnn_create_binary_elementwise_nd and create_pack_lh the operator struct is allocated first and then a sub-buffer (compute, and resize_op->convolution_op), but a failed sub-buffer allocation returns out-of-memory directly and leaks the partial operator, whereas the sibling creates (softmax-nc, fully-connected-nc, batch-matrix-multiply-nc, reduce-nd, slice-nd, transpose-nd, the pooling ops) all release it via goto error; this releases it with xnn_delete_operator before the same return.

@copybara-service copybara-service Bot merged commit a27ef62 into google:master Jun 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant