[PATCH synaptics] Init num_touches to 0 on start

Peter Hutterer peter.hutterer at who-t.net
Wed Apr 25 19:56:28 PDT 2012


On Wed, Apr 25, 2012 at 06:22:07PM -0700, Chase Douglas wrote:
> On 04/25/2012 05:36 PM, Peter Hutterer wrote:
> > We implicitly rely on this already since we calloc the struct. Do it
> > expliclity on DeviceOn().
> > 
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> > This half of the fix to 49161 a bit redundant but better safe than sorry,
> > they say.
> 
> I have not problems with it, but this is basically how things are done
> all over the X stack. It's assumed structs are calloc'd where it isn't
> obvious pretty much. Does this mean we have to take up arms against all
> uninitialized members? :)

in this case the struct alloc is only called once (DEVICE_INIT) but the
struct is re-used for each DeviceOn(). So forcing it to known zero before
it's being used seems sensible.

> Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

thanks.

Cheers,
  Peter


More information about the xorg-devel mailing list