This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e2aec529cb2 coverity: Dereferencing after a null check (FORWARD_NULL)
e2aec529cb2 is described below
commit e2aec529cb2382f57b13962fd6c0a51c20648e22
Author: hujun5 <[email protected]>
AuthorDate: Fri Aug 8 09:11:15 2025 +0800
coverity: Dereferencing after a null check (FORWARD_NULL)
Add proper null pointer validation and fix potential dereference after null
check in scheduler critical sections. This addresses Coverity FORWARD_NULL
defect by ensuring pointers are checked before use and maintaining defensive
coding practices throughout the scheduler implementation.
Signed-off-by: hujun5 <[email protected]>
---
sched/sched/sched_mergepending.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sched/sched/sched_mergepending.c b/sched/sched/sched_mergepending.c
index d48e1ebc2f7..8101c773212 100644
--- a/sched/sched/sched_mergepending.c
+++ b/sched/sched/sched_mergepending.c
@@ -96,7 +96,7 @@ bool nxsched_merge_pending(void)
*/
for (;
- (rtcb && ptcb->sched_priority <= rtcb->sched_priority);
+ (ptcb->sched_priority <= rtcb->sched_priority);
rtcb = rtcb->flink)
{
}