Several MTD FLASH drivers nullify the freed 'priv' structure and failed to return NULL as stated in the comments. Result, will operate on a NULL pointer later. Noted by David Sidrane.
This commit is contained in:
parent
bde90de12f
commit
5b6fafb3f5
@ -673,7 +673,7 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev)
|
|||||||
|
|
||||||
ferr("ERROR: Unrecognized\n");
|
ferr("ERROR: Unrecognized\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -978,7 +978,7 @@ FAR struct mtd_dev_s *is25xp_initialize(FAR struct spi_dev_s *dev)
|
|||||||
|
|
||||||
ferr("ERROR: Unrecognized\n");
|
ferr("ERROR: Unrecognized\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -999,4 +999,3 @@ FAR struct mtd_dev_s *is25xp_initialize(FAR struct spi_dev_s *dev)
|
|||||||
finfo("Return %p\n", priv);
|
finfo("Return %p\n", priv);
|
||||||
return (FAR struct mtd_dev_s *)priv;
|
return (FAR struct mtd_dev_s *)priv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1033,7 +1033,7 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev)
|
|||||||
|
|
||||||
ferr("ERROR: Unrecognized\n");
|
ferr("ERROR: Unrecognized\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -826,7 +826,7 @@ FAR struct mtd_dev_s *ramtron_initialize(FAR struct spi_dev_s *dev)
|
|||||||
/* Unrecognized! Discard all of that work we just did and return NULL */
|
/* Unrecognized! Discard all of that work we just did and return NULL */
|
||||||
|
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1208,7 +1208,7 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev)
|
|||||||
|
|
||||||
ferr("ERROR: Unrecognized\n");
|
ferr("ERROR: Unrecognized\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -956,7 +956,7 @@ FAR struct mtd_dev_s *sst25xx_initialize(FAR struct spi_dev_s *dev)
|
|||||||
|
|
||||||
ferr("ERROR: Unrecognized\n");
|
ferr("ERROR: Unrecognized\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -934,7 +934,7 @@ FAR struct mtd_dev_s *sst26_initialize_spi(FAR struct spi_dev_s *dev)
|
|||||||
|
|
||||||
ssterr("ERROR: Unrecognized\n");
|
ssterr("ERROR: Unrecognized\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1258,7 +1258,7 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi)
|
|||||||
|
|
||||||
ferr("ERROR: Unrecognized\n");
|
ferr("ERROR: Unrecognized\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
priv = NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user