Staging: slicoss: Fix smatch warning in slicoss.c
authorMonam Agarwal <monamagarwal123@gmail.com>
Thu, 27 Mar 2014 14:31:01 +0000 (20:01 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2014 23:05:12 +0000 (16:05 -0700)
This patch fixes following smatch warning:
slicoss/slicoss.c:1429 slic_cmdq_addcmdpage() error: we previously assumed 'pslic_handle' could be null

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/slicoss/slicoss.c

index e27b88f02ccdb5cf778d2b2d8d597ed88d264060..f350e6028ed2362a62ca480871a4b27e1da8aa8f 100644 (file)
@@ -1422,8 +1422,7 @@ static void slic_cmdq_addcmdpage(struct adapter *adapter, u32 *page)
                spin_lock_irqsave(&adapter->handle_lock.lock,
                                adapter->handle_lock.flags);
                pslic_handle  =  adapter->pfree_slic_handles;
-               if (pslic_handle)
-                       adapter->pfree_slic_handles = pslic_handle->next;
+               adapter->pfree_slic_handles = pslic_handle->next;
                spin_unlock_irqrestore(&adapter->handle_lock.lock,
                                adapter->handle_lock.flags);
                pslic_handle->type = SLIC_HANDLE_CMD;