On Thu, Apr 26, 2012 at 10:00:47AM +0100, Bastien Nocera wrote:
> On Thu, 2012-04-26 at 15:50 +1000, Peter Hutterer wrote:
> > For bluetooth devices, the PRODUCT is set on the event device. For
> > inputattached serial devices, the PRODUCT Is on the parent instead.
> > 
> > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> > ---
> > Changes to v1:
> > - don't unref the parent while we're still using product_str
> > - get parent from old_parent (no functional change)
> > - gheck for parent != NULL before fetching product. If parent is NULL, this
> >   will just move the segfault down to the assert(product_str)
> > 
> >  libwacom/libwacom.c |   21 +++++++++++++++------
> >  1 file changed, 15 insertions(+), 6 deletions(-)
> > 
> > diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> > index 1aeadcd..b966280 100644
> > --- a/libwacom/libwacom.c
> > +++ b/libwacom/libwacom.c
> > @@ -156,7 +156,8 @@ get_device_info (const char   *path,
> >  
> >             *vendor_id = strtol (vendor_str, NULL, 16);
> >             *product_id = strtol (product_str, NULL, 16);
> > -   } else if (*bus == WBUSTYPE_BLUETOOTH) {
> > +   } else if (*bus == WBUSTYPE_BLUETOOTH || *bus == WBUSTYPE_SERIAL) {
> > +           GUdevDevice *parent;
> 
> Isn't this shadowing another declaration? You have a "parent" being used
> in another branch of a conditional below:
> <snip>
> > -   } else if (*bus == WBUSTYPE_SERIAL) {
> > -           /* FIXME This matches the declaration in serial-wacf004.tablet
> > -            * Might not be good enough though */
> > -           *vendor_id = 0;
> > -           *product_id = 0;
> > +           if (parent)
> > +                   g_object_unref (parent);
> 
> Here.

this is just a bad diff. the parent here is the one declared in the hunk
above (the WBUSTYPE_SERIAL condition was moved, so they fall together now).

There is one more parent object but that's local too and expires before we
get to this block.
 
Cheers,
  Peter

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to