From c4e9bab97c6072058c2ffeb4fcd7ea2126866bbb Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 1 Jun 2017 03:49:26 +0000 Subject: [PATCH] scst: scst_free_acg() not dereference NULL acg->tgt for proc interface Signed-off-by: David Butterfield git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7199 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 64424306f..9393364b9 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -4728,7 +4728,8 @@ static void scst_free_acg(struct scst_acg *acg) struct scst_acn *acn, *acnt; struct scst_tgt *tgt = acg->tgt; - TRACE_DBG("Freeing acg %s/%s", tgt->tgt_name, acg->acg_name); + /* For procfs acg->tgt could be NULL */ + TRACE_DBG("Freeing acg %s/%s", tgt ? tgt->tgt_name : "(tgt=NULL)", acg->acg_name); list_for_each_entry_safe(acg_dev, acg_dev_tmp, &acg->acg_dev_list, acg_dev_list_entry) {