浏览代码

isdn: eicon: free pointer after using it in log msg in divas_um_idi_delete_entity()

Not really a problem, but nice IMHO; the Coverity static analyzer
complains that we use the pointer 'e' after it has been freed, so move
the freeing below the final use, even if that use is just using the
value of the pointer and not actually dereferencing it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesper Juhl 12 年之前
父节点
当前提交
84557783c5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/isdn/hardware/eicon/um_idi.c

+ 1 - 1
drivers/isdn/hardware/eicon/um_idi.c

@@ -288,9 +288,9 @@ int divas_um_idi_delete_entity(int adapter_nr, void *entity)
 	cleanup_entity(e);
 	diva_os_free(0, e->os_context);
 	memset(e, 0x00, sizeof(*e));
-	diva_os_free(0, e);
 
 	DBG_LOG(("A(%d) remove E:%08x", adapter_nr, e));
+	diva_os_free(0, e);
 
 	return (0);
 }