Hello Cynthia,
I would use the attached fix. I am bit confused about your comment. The
problem seems to be in the worker creation and not the swap function?
On 2013-08-23 05:55, Rempel, Cynthia wrote:
Hi,
If sc happens to not be set to RTEMS_SUCCESSFUL, this function will not swap
the workers... probably won't happen, but submitting a patch anyway.
Thanks,
Cindy
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>From b493db9addb24901d8cd9037fd6fb12296aa0b9b Mon Sep 17 00:00:00 2001
From: Sebastian Huber <sebastian.hu...@embedded-brains.de>
Date: Fri, 23 Aug 2013 10:01:57 +0200
Subject: [PATCH] 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;
--
1.7.7
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel