From 0ab789c4769474fb80d4a83e442e0abb13647986 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 27 Aug 2012 21:45:35 +0000 Subject: [PATCH] scst_local: Remove a superfluous if-test It is not necessary to test whether a pointer is not NULL before invoking kfree(). Detected by smatch. From: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4485 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index efa4d0c33..e7837cdc6 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -582,11 +582,9 @@ static ssize_t scst_local_transport_id_store(struct kobject *kobj, mutex_lock(&sess->tr_id_mutex); - if (sess->transport_id != NULL) { - kfree(sess->transport_id); - sess->transport_id = NULL; - sess->transport_id_len = 0; - } + kfree(sess->transport_id); + sess->transport_id = NULL; + sess->transport_id_len = 0; if (size == 0) goto out_res;