|SUCCESS| [v2] net/ark: fix null dereference on allocation failure
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Wed Jun 3 18:40:57 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/164873
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-06-03
Below is my review of the patch:
---
commit bf73ee28f47b ("net/ark: support single function with multiple port")
Author: Denis Sergeev <denserg.edu at gmail.com>
net/ark: fix null dereference on allocation failure
This patch adds a NULL pointer check after rte_zmalloc_socket() to prevent
a potential NULL dereference in memcpy().
> diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
> index 8b25ed948f..546a44704f 100644
> --- a/drivers/net/ark/ark_ethdev.c
> +++ b/drivers/net/ark/ark_ethdev.c
> @@ -445,6 +445,12 @@ ark_dev_init(struct rte_eth_dev *dev)
> sizeof(struct ark_adapter),
> RTE_CACHE_LINE_SIZE,
> rte_socket_id());
> + if (eth_dev->data->dev_private == NULL) {
> + ARK_PMD_LOG(ERR,
> + "Memory allocation for dev_private failed!"
> + " Exiting.\n");
The error message contains a stray space before the newline and uses an
exclamation mark. Can this follow the more neutral tone used in the existing
code? Also, does the newline need explicit inclusion in ARK_PMD_LOG()
macros, or does the macro handle it?
> + goto error;
> + }
>
> memcpy(eth_dev->data->dev_private, ark,
> sizeof(struct ark_adapter));
Does the error path properly clean up the allocated mac_addrs from the
earlier rte_zmalloc_socket() call at line 434? Looking at the goto error
target, does it handle the case where mac_addrs was allocated but
dev_private allocation failed?
More information about the test-report
mailing list