Check if the spinlock is held before attempting to wait by
taking the semaphore, as that would cause a context switch which
isn't allowed and will trigger an assertion error when
`CONFIG_SPIN_VALIDATE` is enabled.
Logging in spinlock-held context when the log buffer is full can lead
to an infinite assertion error loop, as the logging subsys attempts to
allocate buffer when there's none available, it will try to wait for
one and thus triggers the assertion error, the error message will be
printed through the logging sybsys but there's no buffer available,
so it will try to wait for one and triggers another assertion error..
This loop just goes on and on forever, and nothing gets printed to
the terminal.
Added a test to validate the fix.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Maxim Adelman <imax@meta.com>
(cherry picked from commit 1a578eb72c)
Make sure that the socket service is properly unregistered when
dispatcher is unregistered.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit d98fe73684)
We need to close the socket service context when dispatcher is
unregistered.
Fixes#82652
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit da148ab3bc)
Skip error prints and extra DNS events if DNS dispatcher was already
registered.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit c110331507)
Depending on DNS type, print the output (mDNS vs DNS) correctly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit efcfcfe292)
Resets uart tx fifo during driver initialization to have a well defined
initial condition mainly preventing unwanted characters being sent
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
(cherry picked from commit f0516ead27)
Keep track of the amount of bytes read so no buffer overflow occurs.
Signed-off-by: DEVER Emiel <emiel.dever@psicontrol.com>
(cherry picked from commit 336c650646)
This fixes an issue where wrong values were checked against block device
defaults. Kconfig values are used when no filesystem config values are
provided, and the buffers are sized according to the Kconfig values,
but the checks were only performed against filesystem config variables.
Signed-off-by: Djordje Nedic <nedic.djordje2@gmail.com>
(cherry picked from commit 2750492e86)
The samr21 is a samd21 with a builtin at86rf233 radio. Use the samd21 as
base for these SoC and drop all duplicated nodes.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
(cherry picked from commit 01fc0a750a)
The saml2x series provide USB to all SoC series. This moves the USB node
from saml21.dtsi to the base file saml2x.dtsi.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
(cherry picked from commit 34fc01e008)
The DMA is already defined on the base header. This exclude the
duplicated node.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
(cherry picked from commit 2e7599eac6)
When running tests on sam0 platform was detected that pinctrl for ADC
were not defined for some boards. To force an error at build time
nodes should be explicity disabled. This explicity disable nodes on
devicetree that require some user configuration.
In addition, the adc feature were excluded in some boards and
samr21-xpro was correct updated.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
(cherry picked from commit 162f728787)
Keep a consistent order on the nodes definitions to make it easy to read
between all the SoC series.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
(cherry picked from commit 6f1f598a72)
Fixes an issue introduced with commit
c6ad4a7927 which wrong restarts
advertising after a device connects when it should only restart
advertising if a device fails to connect
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 655be99fa7)
As the erase callback is optional, handler should not check
if it is not NULL.
Fixes#81777
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
(cherry picked from commit 486428951b)
fix out of bounds read by doing the comparison with ARRAY_SIZE correctly
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
(cherry picked from commit 3202773b11)
As the error print strings are very similar, construct the final
output at runtime to save some flash space.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 3c59bd4fb5)
Follow net coding style and remove extra new lines between
variable set and checking its value.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 8deebcec21)
Follow the net coding style and declare the variables at the start
of the function.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit b2056e0966)
We must do null check before trying to access the fields.
Fixes#81980
Coverify-CID: 434549
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 3aa0c8670e)
Update the partition table list with 16MB and 32MB options.
Signed-off-by: Marek Matej <marek.matej@espressif.com>
(cherry picked from commit 2dc2cdea75)
The dns_unpack_answer() did not check the length of the message
properly which can cause out of bounds read.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 6e7fcff579)
Make sure that when copying the qname, the source buffer is large
enough for the data.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 43c2b9cfe8)
If the packet parsing fails in dns_unpack_response_query(), then
do not continue further but bail out early.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit eb2550a441)
We need to drop the cloned packet that was fed to the bridge instead of
returning directly from the function. Without this change we have a
buffer leak.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit c6a1af5c17)
If the packet cloning failed, bail out in order to avoid
null pointer access.
Fixes#81992
Coverity-CID: 434493
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit ed0dcca2fb)
lwm2m_engine_set() and lwm2m_engine_get() locks
the registry_lock mutex, but this is not unlocked
when setting or getting a time resource where the buffer
lengths are invalid resulting in an early return without
unlocking the mutex. This results in a deadlock when
attempting to lock the registry in another thread.
Signed-off-by: Steven Poon <steven-github@outlook.com>
(cherry picked from commit 30b30c29a3)
Addresses in cmd_load() should always be unsigned. Previously, strtol()
was used, which is limited to signed long values, causing issues with
addresses >= 0x80000000. This commit replaces strtol() with strtoul(),
ensuring proper handling of the full 32-bit address space.
Fixes#81343
Signed-off-by: Aaron Fontaine <aaron.fontaine@dojofive.com>
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
(cherry picked from commit 1aaf08f7f1)
Fix extracting role from k_work.
Hot fix for #78914
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
(cherry picked from commit f5409bd3de)
When larger buffer index was introduced only function:
eeprom_target_write_received() was updated to handle
address-width = 16
This adds the same functionality when buffered API is used,
enabled by CONFIG_I2C_TARGET_BUFFER_MODE.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
(cherry picked from commit e6c9e9a2dd)
The #81456 fixed the driver issue related to issue #81454. This add
the RTC configurations on sam_v71_xult board to enable test coverage.
Fixes#81454
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
(cherry picked from commit cffb66f5c6)
Remove unnecessary include in header and source file.
gmtime_r() is an extension to the C library, and therefore one
needs to explicitly ask for its prototype to have it exposed.
This is done by defining _POSIX_C_SOURCE so let's do so.
These two changes fix build errors with some libCs.
Tested with pico, newlib, minimal and the host glibc.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit a785548df6)
Enabling CONFIG_FPU and CONFIG_FPU_SHARING requires the
definition of `arch_float_disable` and `arch_float_enable`.
Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
(cherry picked from commit e7c353bf14)
- Sets s26ks512s0 flash write-block-size to correct 256KB.
- Optimizes MCUboot partitions to fit the correct write-block-size.
Fixes#80284
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
(cherry picked from commit a730d9abad)
This flag is now unused in OSAL as it takes the input via the API.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
(cherry picked from commit f537cf311d)
Pass passive scan and offloaded raw tx feature flags to OSAL.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
(cherry picked from commit 62e06a5072)
\verbatim is not giving the right output as we need an inline literal.
Switch to \c instead.
Fixes#81595.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit 83356e924a)
1. Move deprecated items to the deprecated section.
2. Fixed a portion of a sentence that was deleted.
3. Miscellaneous cleanup.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>