This could explain inconsistent behaviour, intialized was accessed uninitialized (oh, the irony!).
For good effort, calloc _and_ initialize "initialized". Two zeros are more than one, after all. Signed-off-by: Peter Hutterer <[email protected]> --- Ping is experiencing some issues with the new serial code. Unfortunately this patch alone doesn't fix it yet but it's definitely a bug that should be fixed. src/wcmISDV4.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c index 4c75da6..e75cc43 100644 --- a/src/wcmISDV4.c +++ b/src/wcmISDV4.c @@ -188,7 +188,7 @@ static Bool isdv4ParseOptions(LocalDevicePtr local) } if (!common->private && - !(common->private = malloc(sizeof(wcmISDV4Data)))) + !(common->private = calloc(1, sizeof(wcmISDV4Data)))) { xf86Msg(X_ERROR, "%s: failed to alloc backend-specific data.\n", local->name); @@ -196,6 +196,7 @@ static Bool isdv4ParseOptions(LocalDevicePtr local) isdv4data = common->private; isdv4data->baudrate = baud; + isdv4data->initialized = 0; return TRUE; } -- 1.7.1 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
