net: ldpaa_eth: Fix buffer overflow in memset

In ldpaa_eth_open a memset is used to initialise a struct to 0 but the
size passed is that of a different struct. Correct to pass the sizeof
the struct that is being initialised.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This commit is contained in:
Andrew Goodbody
2025-08-05 11:52:00 +01:00
committed by Jerome Forissier
parent 4800a6a0b3
commit ed3b08874f

View File

@@ -458,7 +458,7 @@ static int ldpaa_eth_open(struct udevice *dev)
link_state.up == 1 ? printf("up\n") : printf("error state\n");
#endif
memset(&d_queue, 0, sizeof(struct dpni_queue));
memset(&d_queue, 0, sizeof(struct dpni_queue_id));
err = dpni_get_queue(dflt_mc_io, MC_CMD_NO_FLAGS,
dflt_dpni->dpni_handle, DPNI_QUEUE_RX,
0, 0, &d_queue_cfg, &d_queue);