mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 04:13:33 +08:00
Some error handling bugs noted by Ronen Vainish
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5122 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -3300,4 +3300,9 @@
|
|||||||
but tested has been deferred until I get the right tools.
|
but tested has been deferred until I get the right tools.
|
||||||
* arch/arc/include/stm32/chip.h and arch/arm/src/stm32/chip.h:
|
* arch/arc/include/stm32/chip.h and arch/arm/src/stm32/chip.h:
|
||||||
Add support for the STM32F103VET6.
|
Add support for the STM32F103VET6.
|
||||||
|
* fs/fs_fdopen.c: Bad check for failure to allocate memory. (Noted
|
||||||
|
by Ronen Vainish).
|
||||||
|
* drivers/mmcsd/mmcsd_sdio.c: If the MMC/SD driver were ever
|
||||||
|
uninitialized then there would be a double release of memory
|
||||||
|
(Noted by Ronen Vainish).
|
||||||
|
|
||||||
|
|||||||
@@ -3171,7 +3171,9 @@ errout_with_buffers:
|
|||||||
rwb_uninitialize(&priv->rwbuffer);
|
rwb_uninitialize(&priv->rwbuffer);
|
||||||
errout_with_hwinit:
|
errout_with_hwinit:
|
||||||
#endif
|
#endif
|
||||||
mmcsd_hwuninitialize(priv);
|
mmcsd_hwuninitialize(priv); /* This will free the private data structure */
|
||||||
|
return ret;
|
||||||
|
|
||||||
errout_with_alloc:
|
errout_with_alloc:
|
||||||
kfree(priv);
|
kfree(priv);
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR _TCB *tcb)
|
|||||||
/* Allocate the IO buffer */
|
/* Allocate the IO buffer */
|
||||||
|
|
||||||
stream->fs_bufstart = kmalloc(CONFIG_STDIO_BUFFER_SIZE);
|
stream->fs_bufstart = kmalloc(CONFIG_STDIO_BUFFER_SIZE);
|
||||||
if (!stream)
|
if (!stream->fs_bufstart)
|
||||||
{
|
{
|
||||||
err = ENOMEM;
|
err = ENOMEM;
|
||||||
goto errout_with_sem;
|
goto errout_with_sem;
|
||||||
|
|||||||
Reference in New Issue
Block a user