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:
parent
67686c231a
commit
8098c80338
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -1247,7 +1247,6 @@ int stm32l4_1wireuninitialize(struct onewire_dev_s *dev)
|
||||
if (--priv->refs)
|
||||
{
|
||||
nxmutex_unlock(&priv->lock);
|
||||
kmm_free(priv);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user