[Cbe-oss-dev] [PATCH] libspe: fix uninitialized structure member in spe_get_event
Kazunori Asayama
asayama at sm.sony.co.jp
Tue Jun 13 23:11:59 EST 2006
Hi all,
spe_get_event may return fewer events than actually available,
because it refers to an uninitialized member of poll_helper structure.
Here is a patch to fix the problem. This patch should be applied
against the development release of libspe version 1.1.0 on BSC website.
--
(ASAYAMA Kazunori
(asayama at sm.sony.co.jp))
t
Index: libspe-1.1.0/spe.c
===================================================================
--- libspe-1.1.0.orig/spe.c 2006-06-08 21:30:11.000000000 +0900
+++ libspe-1.1.0/spe.c 2006-06-08 21:29:17.000000000 +0900
@@ -1367,6 +1367,7 @@
phelper[setupSPEs].event=i;
phelper[setupSPEs].thread=thread;
+ phelper[setupSPEs].retfd = -1;
phelper[setupSPEs].type=1;
//printf("1\n");
setupSPEs++;
@@ -1380,6 +1381,7 @@
phelper[setupSPEs].event=i;
phelper[setupSPEs].thread=thread;
+ phelper[setupSPEs].retfd = -1;
phelper[setupSPEs].type=2;
//printf("2\n");
setupSPEs++;
@@ -1391,6 +1393,7 @@
phelper[setupSPEs].event=i;
phelper[setupSPEs].thread=thread;
+ phelper[setupSPEs].retfd = -1;
phelper[setupSPEs].type=3;
if (SPEfds[setupSPEs].fd == -1)
fprintf(stderr, "Warning: spe_get_events: attempting "
More information about the cbe-oss-dev
mailing list