mirror of
https://github.com/apache/nuttx.git
synced 2026-06-09 10:54:43 +08:00
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:
@@ -1281,6 +1281,7 @@ int apds9960_register(FAR const char *devpath,
|
||||
{
|
||||
snerr("ERROR: Failed to register driver: %d\n", ret);
|
||||
kmm_free(priv);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Attach to the interrupt */
|
||||
|
||||
Reference in New Issue
Block a user