[PATCH 2/3] grspw.c: Fix Unchecked return value (CID #1399781)
Gedare Bloom
gedare at rtems.org
Mon Mar 1 16:57:37 UTC 2021
Someone (Daniel) from Gaisler should review.
On Mon, Mar 1, 2021 at 9:24 AM Ryan Long <thisisryanlong at gmail.com> wrote:
>
> CID 1399781: Unchecked return value in grspw_device_init().
>
> Closes #4259
> ---
> bsps/shared/grlib/spw/grspw.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/bsps/shared/grlib/spw/grspw.c b/bsps/shared/grlib/spw/grspw.c
> index 1b50cc6..74a0fc7 100644
> --- a/bsps/shared/grlib/spw/grspw.c
> +++ b/bsps/shared/grlib/spw/grspw.c
> @@ -465,6 +465,7 @@ int grspw_device_init(GRSPW_DEV *pDev)
> struct amba_dev_info *ambadev;
> struct ambapp_core *pnpinfo;
> union drvmgr_key_value *value;
> + rtems_status_code status;
>
> /* Get device information from AMBA PnP information */
> ambadev = (struct amba_dev_info *)pDev->dev->businfo;
> @@ -555,21 +556,23 @@ int grspw_device_init(GRSPW_DEV *pDev)
> return RTEMS_NO_MEMORY;
>
> /* Create semaphores */
> - rtems_semaphore_create(
> + status = rtems_semaphore_create(
> rtems_build_name('T', 'x', 'S', '0' + pDev->minor),
> 0,
> RTEMS_FIFO | RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY | \
> RTEMS_NO_PRIORITY_CEILING,
> 0,
> &(pDev->txsp));
> + _Assert_Unused_variable_equals(status,RTEMS_SUCCESSFUL);
space needed after comma
>
> - rtems_semaphore_create(
> + status = rtems_semaphore_create(
> rtems_build_name('R', 'x', 'S', '0' + pDev->minor),
> 0,
> RTEMS_FIFO | RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY | \
> RTEMS_NO_PRIORITY_CEILING,
> 0,
> &(pDev->rxsp));
> + _Assert_Unused_variable_equals(status,RTEMS_SUCCESSFUL);
space needed after comma
>
> grspw_hw_init(pDev);
>
> --
> 1.8.3.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
More information about the devel
mailing list