drivers/sensors/apds9960.c: Fix use after free
Memory pointed by priv may be used (in line 1289) after it is freed in line 1283. Fix by adding the missing return statement in error handling. Signed-off-by: Mingjie Shen <shen497@purdue.edu>
This commit is contained in:
parent
9603288c80
commit
209bee3266
|
@ -1281,6 +1281,7 @@ int apds9960_register(FAR const char *devpath,
|
||||||
{
|
{
|
||||||
snerr("ERROR: Failed to register driver: %d\n", ret);
|
snerr("ERROR: Failed to register driver: %d\n", ret);
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attach to the interrupt */
|
/* Attach to the interrupt */
|
||||||
|
|
Loading…
Reference in New Issue