mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 07:51:28 +00:00
iscsi-scstd: Fix a dereference-before-null-check
Detected by Coverity. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6366 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -172,11 +172,11 @@ void session_free(struct session *session)
|
||||
{
|
||||
log_debug(1, "Freeing session sid %#"PRIx64, session->sid.id64);
|
||||
|
||||
kernel_session_destroy(session->target->tid, session->sid.id64);
|
||||
|
||||
if (session->target) {
|
||||
struct target *target = session->target;
|
||||
|
||||
kernel_session_destroy(target->tid, session->sid.id64);
|
||||
|
||||
target->sessions_count--;
|
||||
log_debug(1, "target %s, sessions_count %d", target->name,
|
||||
target->sessions_count);
|
||||
|
||||
Reference in New Issue
Block a user