Skip to content

[Do Not Merge]Replace DEBUGASSERT with runtime null pointer checks#7255

Open
jijo-jacob wants to merge 1 commit intoSamsung:masterfrom
jijo-jacob:master
Open

[Do Not Merge]Replace DEBUGASSERT with runtime null pointer checks#7255
jijo-jacob wants to merge 1 commit intoSamsung:masterfrom
jijo-jacob:master

Conversation

@jijo-jacob
Copy link
Copy Markdown

To improve embedded system reliability by ensuring graceful error handling. Replace DEBUGASSERT() macro calls with proper runtime null pointer validation.

To improve embedded system reliability by ensuring graceful error handling.
Replace DEBUGASSERT() macro calls with proper runtime null pointer validation.

Signed-off-by: jijo jacob <jijo.jacob@samsung.com>
{
/* Power-up and configure GPIOs */
DEBUGASSERT(priv);
if (!priv) {
Copy link
Copy Markdown
Contributor

@ewoodev ewoodev Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please let me know why we need to change return error from DEBUGASSERT?

is priv allowed to be null?
is the BSP code handling error during booting?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will change only for syscall, ioctl etc. Not during the booting.
And we also add checks to handle return error in case of syscall.

@jijo-jacob jijo-jacob changed the title Replace DEBUGASSERT with runtime null pointer checks [Do Not Merge]Replace DEBUGASSERT with runtime null pointer checks Apr 9, 2026
@ewoodev
Copy link
Copy Markdown
Contributor

ewoodev commented Apr 10, 2026

I'd like to provide infomation regarding this change.
The reason we made the change previously is that the kernel crashes when the argument received from the user is null.
(from syscall)

Resources like "priv" cannot be null. If it becomes null, the data, bss, or heap is corrupted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants