Jelajahi Sumber

timer-list: Return error on adding NULL callback

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 5 tahun lalu
induk
melakukan
dc244ea404
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      qdevices/timer-list.c

+ 2 - 2
qdevices/timer-list.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2016 Red Hat, Inc.
+ * Copyright (c) 2015-2020 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -115,7 +115,7 @@ timer_list_add(struct timer_list *tlist, PRUint32 interval, timer_list_cb_fn fun
 {
 {
 	struct timer_list_entry *new_entry;
 	struct timer_list_entry *new_entry;
 
 
-	if (interval < 1 || interval > TIMER_LIST_MAX_INTERVAL) {
+	if (interval < 1 || interval > TIMER_LIST_MAX_INTERVAL || func == NULL) {
 		return (NULL);
 		return (NULL);
 	}
 	}