[rtems commit] libblock: Avoid uninitialized variable

Sebastian Huber sebh at rtems.org
Mon Aug 26 07:47:34 UTC 2013


Module:    rtems
Branch:    master
Commit:    842d63bae55208ad4c47c756e11f98e4fcb95a58
Changeset: http://git.rtems.org/rtems/commit/?id=842d63bae55208ad4c47c756e11f98e4fcb95a58

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Aug 23 10:01:57 2013 +0200

libblock: Avoid uninitialized variable

---

 cpukit/libblock/src/bdbuf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index 0fbafaa..b7663f1 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -1348,8 +1348,7 @@ rtems_bdbuf_swapout_workers_create (void)
 
   worker_size = rtems_bdbuf_swapout_worker_size ();
   worker_current = calloc (1, bdbuf_config.swapout_workers * worker_size);
-  if (!worker_current)
-    sc = RTEMS_NO_MEMORY;
+  sc = worker_current != NULL ? RTEMS_SUCCESSFUL : RTEMS_NO_MEMORY;
 
   bdbuf_cache.swapout_workers = (rtems_bdbuf_swapout_worker *) worker_current;
 




More information about the vc mailing list