Ensure 'params' is not NULL before accessing its fields.
Prevents possible null pointer dereference when calling
strlen(params->ssid).
Delay access to ssid->ssid and ssid->ssid_len until after null check.
Prevents potential crash if wpa_s->current_ssid is NULL.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Offloaded socket implementations need to create the socket operations
vtable, therefore need access to struct socket_op_vtable. So far this
has been defined in a private header, so implementations needed to add
the header location to the include path in CMake.
Therefore, move struct socket_op_vtable definition to the internal part
of the public socket header, so it's no longer needed to include a
private header. This is also more consistent with the rest of the public
header content, as for example macros needed to register a socket
implementation are already there.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The .rodata_in_data section is produced by MWDT toolchain with -Hccm
option enabled. This option moves read-only data from the executable
memory (ICCM) to the data memory (DCCM), improving performance by
reducing conflicts between instruction fetches and data fetches.
Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
Deleted a redundant check for 'rpu_ctx_zep' pointer after it was already
dereferenced.
Clarifies code logic in nrf_wifi_get_power_save_config function.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Fix the conditional compilation to use `CONFIG_MBEDTLS_PKCS1_V21`
instead of `CONFIG_MBEDTLS_PKCS1_V15` when enabling `MBEDTLS_PKCS1_V21`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Wrap K_HEAP_DEFINE to fit within 100-character CI limit and apply
consistent spacing.This is a formatting-only change.
Signed-off-by: sudarsan N <sudarsansamy2002@gmail.com>
Adds an assertion and runtime log to ensure 'step' is not zero before
using it in division,preventing undefined behavior without modifying
the public API.
Avoids a signature change (void → int) to preserve API stability for
Zephyr 4.2.A more complete solution can be proposed for 4.3.
CID: 444378
Signed-off-by: sudarsan N <sudarsansamy2002@gmail.com>
Add 4.2.0 release notes for networking and move the PM section which
somehow ended up inside Networking.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fixed selectors that probably went stale overtime since the custom.css
was adopted from Godot and RTD having evolved in the meantime and that
were causing +/- icons to expand/collapse the navtree to be putting
margins where they shouldn't have.
Fixeszephyrproject-rtos/zephyr#78974
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Another take on zephyrproject-rtos/zephyr#76953.
This uses STRIP_FROM_INC_PATH to make sure #include snippets in the
documentation are not absolute paths and reflect what one would
actually use in their code.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
for DEVICE_PM and DEVICE_PM_RUNTIME, ztest need
hold status like CONFIG_PM, otherwise the following
flash will be blocked for some SOC
Signed-off-by: Hake Huang <hake.huang@nxp.com>
Both bt_le_adv_stop() and bt_le_adv_resume() were logging same
error message. Add aditional context to it so that logs are
distinguishable.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Fix for CID 529870, where Coverity found an issue where `timespec.tv_sec`
is never greater than `UINT64_MAX / NSEC_PER_SEC` (18446744073).
This is naturally true when `time_t` is only 32-bit, which is actually
never the case for any Zephyr platform aside from `native_sim/native/32`.
When `time_t` is a signed 64-bit value, at some point in the future, but
maybe not in our lifetimes, `timespec.tv_sec` could exceed 18446744073,
since `INT64_MAX > UINT64_MAX / NSEC_PER_SEC`.
We should not see coverity issues errors like this in the future, once we
have a consistent `time_t` representation across all Zephyr platforms.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Fix regression caused by memset() replacement to zero volatile struct.
ESP32-C6 data_buf struct differs from other SoCs and needs custom
handling.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
s/net_if_get_by_ifindex/net_if_get_by_iface/
Fixes: 0e57844b2d ("drivers: wifi: esp_at: Bind DNS to device net
interface")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Fix amp to milliamp conversion where a 10^4 factor was applied instead
of 10^3.
Adjust existing test cases accordingly (including a small change to one
of the expected RMS values in pm.power_states that either changed
since the test was introduced or was set too aggressively back then).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
A segmentation fault occurs when a zero initialized struct with a string
field (JSON_TOK_STRING) is encoded. Encode a string null pointer as an
empty JSON string "".
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
Fixed a problem where the command line option --vla was used
with C++ causing a command line error in the IAR ICCARM compiler.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
clang-tidy reports a bugprone-sizeof-expression warning for
sizeof((__v)) when __v is a pointer type. This is a false-positive
in contexts like logging with %p, where using a pointer is
intentional and expected.
Add a NOLINT comment to suppress the warning in static analysis.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
clang-tidy reports a performance-no-int-to-ptr warning due to the cast
(const char *)(uintptr_t)(v).
Previously, only char * was cast to const char *, but there's no downside
to constifying all pointer types.
This change updates the Z_CONSTIFY macro to apply const consistently,
which even aligns better with its name and resolves the warning.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
The reset commands were sent only in SPI mode, causing the device not to
be properly reset when in QPI mode. On the STM32H747I-DISCO boards, this
was causing the driver initialization to fail due to a bad SFDP magic
after flashing the external memory using STM32CubeProgrammer since the
external loader is configuring the flash memory in QPI mode.
The commands are sent in QPI mode first, then in SPI mode:
- If the flash memory was in QPI mode, the two first reset commands are
processed and after reset, the flash memory is in SPI mode and
correctly handles the SPI mode reset commands.
- If the flash memory was in SPI mode, for each QPI command the chip
select signal will be released before the flash memory had the
opportunity to receive a whole command (1 byte), so the partially
received commands will be ignored and won't cause any harm. Then, the
chip is reset by the commands sent in SPI mode.
Signed-off-by: Thomas Altenbach <altenbach.thomas@gmail.com>
Add a workaround which sets the isolation level to 2 in CMake.
The TF-M tests require the large TF-M profile because it supports
the full list of crypto algorithms needed, not because of the
solation level.
For the TF-M tests the isolation level is irrelevant so we
set it to 2 here so that we don't exclude the platforms which
don't support the isolation level 3.
I communicated with a TF-M maintainer and he informed me that this
workaround will be included in the TF-M 2.2 release branch later
so this is a short lived workaround that can be reverted when the
relevant commit from the TF-M branch is cherry-picked.
Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
This is not really high priority to support and is disrupting test
reporting, for now just hotfix the test by returning that this is not
supported, it's not really necessary anyways, there's multiple ways to
call the API to achieve the same effect.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
There is really no need for this header file at all besides if
there is a requirement to be annoying.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This data update returns an error, we should propogate it where it is
called if there is an error returned.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The transfer must be aborted before clearing the status flags otherwise
they will be set again before the transfer is aborted and stay set
causing infinite interrupt.
Also, elevate the log message to error level and give it actual useful
information. The "flag" being logged before literally just is a bit that
says if there is an error or not, which we already know by virtue of
handling an error. The channel error status has actual details about
what was the reason of the error. Also this status should be reported
before the transfer is aborted to get the right status.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Adhere to Programming Guide with regards to when the DIEPCTL0.CNAK is
set. This allows the driver to survive abusive control transfers with
extremely short host timeouts.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
For unclear reason yet, cache activation on PSRAM causes stability issues
when using LTDC.
Disable cache for now.
We'll re-enable once the issue is better understood and fixed.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Some of the locks are created in supervisor mode (i.e. stdout one),
but should be accessed from user mode too. Unfortunately, there is
no way to distinguish these locks, so grant the access to all of them
as the actual reads and writes should end up as syscalls anyway.
Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
The ARC MWDT C library puts some constructors into .ctors section
to initialize its internal stdio locks. Enable the initializers
to make sure these constructors are actually executed.
Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
Use :c:func:`xxx` and :c:type:`xxx` when applicable, as well as reword
a deprecation to make the replacement appear.
Signed-off-by: Josuah Demangeon <me@josuah.net>