arch: Don't free the context if the reference doesn't equal zero

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-11-09 19:24:25 +08:00 committed by Masayuki Ishikawa
parent 67686c231a
commit 8098c80338
6 changed files with 0 additions and 6 deletions

View File

@ -2804,7 +2804,6 @@ int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
if (--priv->refs)
{
nxmutex_unlock(&priv->lock);
kmm_free(dev);
return OK;
}

View File

@ -2803,7 +2803,6 @@ int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
if (--priv->refs)
{
nxmutex_unlock(&priv->lock);
kmm_free(dev);
return OK;
}

View File

@ -2842,7 +2842,6 @@ int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
if (--priv->refs)
{
nxmutex_unlock(&priv->lock);
kmm_free(dev);
return OK;
}

View File

@ -2805,7 +2805,6 @@ int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
if (--priv->refs)
{
nxmutex_unlock(&priv->lock);
kmm_free(dev);
return OK;
}

View File

@ -1247,7 +1247,6 @@ int stm32l4_1wireuninitialize(struct onewire_dev_s *dev)
if (--priv->refs)
{
nxmutex_unlock(&priv->lock);
kmm_free(priv);
return OK;
}

View File

@ -3007,7 +3007,6 @@ int stm32l4_i2cbus_uninitialize(struct i2c_master_s *dev)
if (--priv->refs)
{
nxmutex_unlock(&priv->lock);
kmm_free(dev);
return OK;
}