Thread (11 messages) 11 messages, 2 authors, 2025-09-26

Re: [PATCH net-next v3 4/5] bnxt_fwctl: Add bnxt fwctl device

From: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: 2025-09-26 17:23:48

On Fri, Sep 26, 2025 at 10:41 PM Pavan Chebbi [off-list ref] wrote:
On Fri, Sep 26, 2025 at 9:31 PM Dave Jiang [off-list ref] wrote:
quoted
quoted
quoted
+     if (msg->num_dma) {
+             if (msg->num_dma > MAX_NUM_DMA_INDICATIONS) {
+                     dev_err(dev, "DMA buffers exceed the number supported\n");
+                     err = -EINVAL;
+                     goto free_msg_out;
Shouldn't rpc_in.resp get freed with an error returned? It's leaking rpc_in.resp on all the error paths from this point onward.

DJ
Isn't the caller taking care of it? The fw_rpc is called as:
void *outbuf __free(kvfree) = fwctl->ops->fw_rpc()
I was expecting that outbuf will be freed once it goes out of scope,
regardless of success or error?
Oh, the buffer is not returned when there is an error :( I should have
seen that.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help