From 3f22eb9b95f4263776dc63a7ca77e4ee6ffd8491 Mon Sep 17 00:00:00 2001 From: mlelstv Date: Sun, 5 Jun 2016 09:03:10 +0000 Subject: [PATCH] initialize before check. --- sys/dev/iscsi/iscsi_utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/iscsi/iscsi_utils.c b/sys/dev/iscsi/iscsi_utils.c index fab11fdaf914..9e706245fb6b 100644 --- a/sys/dev/iscsi/iscsi_utils.c +++ b/sys/dev/iscsi/iscsi_utils.c @@ -1,4 +1,4 @@ -/* $NetBSD: iscsi_utils.c,v 1.16 2016/06/05 05:41:53 mlelstv Exp $ */ +/* $NetBSD: iscsi_utils.c,v 1.17 2016/06/05 09:03:10 mlelstv Exp $ */ /*- * Copyright (c) 2004,2005,2006,2008 The NetBSD Foundation, Inc. @@ -367,9 +367,10 @@ throttle_ccb(ccb_t *ccb, bool yes) { session_t *sess; + sess = ccb->session; + KASSERT(mutex_owned(&sess->lock)); - sess = ccb->session; if (yes) { KASSERT((ccb->flags & CCBF_THROTTLING) == 0); KASSERT((ccb->flags & CCBF_WAITQUEUE) == 0);