mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-09 04:39:34 +00:00
dm: refine 'assert' usage in timer.c and rtc.c
- 'assert' cleanup - fix memory leakage in vrtc_init() Tracked-On: #3252 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <sys/timerfd.h>
|
||||
|
||||
#include "vmmapi.h"
|
||||
@@ -51,7 +50,9 @@ timer_handler(int fd __attribute__((unused)),
|
||||
return;
|
||||
}
|
||||
|
||||
assert(size > 0 && nexp > 0);
|
||||
/* check the validity of timer expiration. */
|
||||
if ((size == 0) || (nexp == 0))
|
||||
return;
|
||||
|
||||
if ((cb = timer->callback) != NULL) {
|
||||
(*cb)(timer->callback_param, nexp);
|
||||
|
Reference in New Issue
Block a user