Skip to content
Commit cf0c2a52 authored by Léo BRIAND's avatar Léo BRIAND Committed by Maureen Helm
Browse files

drivers: wifi: eswifi: Fix memory buffer allocation in off_read_work



When receiving data over the eswifi module, we currently read the data
first, then allocate a buffer, and finally write the data into the
buffer. The issue is that if we can't allocate the buffer, the data
that was read is lost. To fix this, we should first attempt to allocate
the buffer before reading any data. If we can't allocate the buffer, we
should not proceed with reading the data. By allocating a buffer with
the MTU size, we can read the packet, write it into the allocated buffer
and then resize by removing unused allocated buffer with
net_pkt_trim_buffer().

Signed-off-by: default avatarLéo BRIAND <leo.briand@smile.fr>
parent 36a1cacb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment