Blame SOURCES/bz1836146-covscan-fixes.patch

573961
commit bfa90160e5856cd91e7c3e58bfd50387a41b8ca9
573961
Author: Christine Caulfield <ccaulfie@redhat.com>
573961
Date:   Wed May 20 11:18:07 2020 +0100
573961
573961
    Some bugs spotted by coverity
573961
573961
diff --git a/include/tlist.h b/include/tlist.h
573961
index bcae55d..723d3ec 100644
573961
--- a/include/tlist.h
573961
+++ b/include/tlist.h
573961
@@ -191,7 +191,7 @@ static inline void timerlist_expire(struct timerlist *timerlist)
573961
 	uint64_t current_time;
573961
 
573961
 	current_monotonic_time = qb_util_nano_current_get();
573961
-	current_time_from_epoch = current_time = qb_util_nano_from_epoch_get();
573961
+	current_time_from_epoch = qb_util_nano_from_epoch_get();
573961
 
573961
 	qb_list_for_each_safe(pos, next, &timerlist->timer_head) {
573961
 
573961
diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c
573961
index 3a0fb7e..cd5089a 100644
573961
--- a/lib/ringbuffer.c
573961
+++ b/lib/ringbuffer.c
573961
@@ -266,7 +266,7 @@ cleanup_hdr:
573961
 	if (fd_hdr >= 0) {
573961
 		close(fd_hdr);
573961
 	}
573961
-	if (rb && (flags & QB_RB_FLAG_CREATE)) {
573961
+	if (rb && (rb->shared_hdr != MAP_FAILED) && (flags & QB_RB_FLAG_CREATE)) {
573961
 		unlink(rb->shared_hdr->hdr_path);
573961
 		if (rb->notifier.destroy_fn) {
573961
 			(void)rb->notifier.destroy_fn(rb->notifier.instance);