ADXL345: Free allocations on failure

This commit is contained in:
Gregory Nutt 2014-12-16 17:27:09 -06:00
parent 09b16e3819
commit 34609141b0

View File

@ -442,6 +442,7 @@ ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_dev_s *dev,
if (ret < 0)
{
sndbg("Wrong Device ID!\n");
kmm_free(priv);
return NULL;
}