From 9f5571db427bb54b1cb887ca3f243668f6524196 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 5 Nov 2019 15:02:38 -0500 Subject: [PATCH] src.ctf.fs: make ds_file_munmap assert that ds_file is not NULL There is no reason for a NULL ds_file to ever be passed to this function. Make it assert that the value is not NULL, to catch potential mistakes. Change-Id: I9261450f35b0a5c74ba182985ecabe2b31eee0a0 Signed-off-by: Simon Marchi --- src/plugins/ctf/fs-src/data-stream-file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/ctf/fs-src/data-stream-file.c b/src/plugins/ctf/fs-src/data-stream-file.c index 4e26d96f..1dacf230 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.c +++ b/src/plugins/ctf/fs-src/data-stream-file.c @@ -58,7 +58,9 @@ int ds_file_munmap(struct ctf_fs_ds_file *ds_file) bt_self_component *self_comp = ds_file->self_comp; bt_logging_level log_level = ds_file->log_level; - if (!ds_file || !ds_file->mmap_addr) { + BT_ASSERT(ds_file); + + if (!ds_file->mmap_addr) { goto end; } -- 2.34.1