mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 17:33:34 +08:00
Systemlib: harden perf counter handling for null ptrs
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-2016 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012-2016 PX4 Development Team. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -419,6 +419,10 @@ perf_reset(perf_counter_t handle)
|
|||||||
void
|
void
|
||||||
perf_print_counter(perf_counter_t handle)
|
perf_print_counter(perf_counter_t handle)
|
||||||
{
|
{
|
||||||
|
if (handle == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
perf_print_counter_fd(1, handle);
|
perf_print_counter_fd(1, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user