From fb98ec7baef88563ae0655322693d0177a03d2ad Mon Sep 17 00:00:00 2001 From: Arnie Reynoso Date: Fri, 14 Mar 2014 10:04:10 -0700 Subject: [PATCH] BIOS: NameServerRemoteNotify callback may have uninitialized var The callback function for NameServerRemoteNotify may end up with an uninitialized swiHandle. Though this case should never happen, the handle should be initialized and an assert must be issued if it remains NULL. This also fixes a Coverity error with the variable. --- packages/ti/sdo/ipc/nsremote/NameServerRemoteNotify.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ti/sdo/ipc/nsremote/NameServerRemoteNotify.c b/packages/ti/sdo/ipc/nsremote/NameServerRemoteNotify.c index 4093250..7cb60be 100644 --- a/packages/ti/sdo/ipc/nsremote/NameServerRemoteNotify.c +++ b/packages/ti/sdo/ipc/nsremote/NameServerRemoteNotify.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013, Texas Instruments Incorporated + * Copyright (c) 2012-2014, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -268,7 +268,7 @@ Void NameServerRemoteNotify_cbFxn(UInt16 procId, UInt16 lineId, UInt32 eventId, UArg arg, UInt32 payload) { NameServerRemoteNotify_Object *obj; - Swi_Handle swiHandle; + Swi_Handle swiHandle = NULL; obj = (NameServerRemoteNotify_Object *)arg; @@ -288,6 +288,10 @@ Void NameServerRemoteNotify_cbFxn(UInt16 procId, UInt16 lineId, UInt32 eventId, /* set object state (used by ROV) */ obj->localState = NameServerRemoteNotify_RECEIVE_RESPONSE; break; + + default: + /* We should never get here but assert if we do */ + Assert_isTrue(swiHandle != NULL, Ipc_A_internal); } Swi_post(swiHandle); -- 2.39.2