]> xenbits.xensource.com Git - xen.git/commitdiff
tmem: remove dumb check in do_tmem_destroy_pool
authorJulien Grall <julien.grall@linaro.org>
Fri, 4 Apr 2014 09:13:32 +0000 (11:13 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 22 May 2014 15:45:50 +0000 (16:45 +0100)
do_tmem_destroy_pool is checking if pools == NULL. But, pools is a fixed
array.

Clang 3.5 will fail to compile xen/common/tmem.c with the following error:
tmem.c:1848:18: error: comparison of array 'client->pools' equal to a null
pointer is always false [-Werror,-Wtautological-pointer-compare]
    if ( client->pools == NULL )

Coverity-ID:1055632

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit ac0f56a2fa407e0704fade12630a5a960dedce87)
(cherry picked from commit 6ce0c3fca9bd1c0d45908452d6e5e9f7bf22f7b7)
(cherry picked from commit 804d9af208c5c95156140b1c62cf8857ba250b03)

xen/common/tmem.c

index 87542a9ec4fc3b84ca4d1659840bce0543fb4114..ae6a64477cc4610270cb77ccedc82413c4cd0f48 100644 (file)
@@ -1874,8 +1874,6 @@ static NOINLINE int do_tmem_destroy_pool(uint32_t pool_id)
     client_t *client = tmh_client_from_current();
     pool_t *pool;
 
-    if ( client->pools == NULL )
-        return 0;
     if ( pool_id >= MAX_POOLS_PER_DOMAIN )
         return 0;
     if ( (pool = client->pools[pool_id]) == NULL )