Possible NULL pointer dereference in libraries/AP_HAL_F4Light/hardware/hal/timer.c

This commit is contained in:
Hyungsub 2018-06-20 11:28:21 -04:00 committed by Andrew Tridgell
parent 7cdb05ccc0
commit ceab853c86

View File

@ -443,9 +443,10 @@ void timer_set_mode(const timer_dev *dev, timer_Channel channel, timer_mode mode
assert_param(channel > 0 && channel <= 4);
/* TODO decide about the basic timers */
assert_param(dev->type != TIMER_BASIC);
if (!dev || dev->type == TIMER_BASIC)
return;
assert_param(dev->type != TIMER_BASIC);
switch (mode) {
case TIMER_DISABLED: