Since semaphore variable stored in stack and will vanish
once the function returned. The same will be accessed in
some other context. So making the variable as static will
initialize the variable content with zeros and also retain
the pointer content.
Coverity ID 18092
Bug
200192398
Change-Id: I94517179604b19f54e3f5e5b3b75b92ab89f1d08
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: http://git-master/r/
1228548
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
for (i = 0; i < dhd_wifi_platdata->num_adapters; i++) {
bool chip_up = FALSE;
int retry;
- struct semaphore dhd_chipup_sem;
+ static struct semaphore dhd_chipup_sem;
adapter = &dhd_wifi_platdata->adapters[i];