Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon: NULL check of logger before use #18788

Merged
merged 1 commit into from Jan 9, 2018
Merged

Conversation

amitkumar50
Copy link

Fixes the coverity issue:

CID 1316234 (#1 of 1): Dereference after null check (FORWARD_NULL)

  1. var_deref_model: remove_session dereferences null this->logger

Signed-off-by: Amit Kumar amitkuma@redhat.com

@amitkumar50
Copy link
Author

jenkins retest this please

1 similar comment
@amitkumar50
Copy link
Author

jenkins retest this please

@@ -3831,6 +3831,7 @@ void Monitor::remove_all_sessions()
Mutex::Locker l(session_map_lock);
while (!session_map.sessions.empty()) {
MonSession *s = session_map.sessions.front();
assert(logger);
remove_session(s);
if (logger)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case youc an remove the if (logger) here?

Fixes the coverity issue:
CID 1316234 (ceph#1 of 1): Dereference after null check (FORWARD_NULL)
6. var_deref_model: remove_session dereferences null this->logger

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
@yuriw
Copy link
Contributor

yuriw commented Jan 6, 2018

@yuriw
Copy link
Contributor

yuriw commented Jan 8, 2018

@yuriw yuriw merged commit a5159a4 into ceph:master Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants