[PATCH joystick] Remove old input ABI leftovers from jstkCoreUnInit

TImo Aaltonen tjaalton at ubuntu.com
Tue Mar 22 00:29:39 PDT 2011


On 22.03.2011 08:42, Peter Hutterer wrote:
> On Fri, Mar 18, 2011 at 07:13:38PM +0200, Timo Aaltonen wrote:
>> From: Timo Aaltonen <timo.aaltonen at canonical.com>
>>
>> Fixes crashes on device unplug:
>> https://bugs.freedesktop.org/show_bug.cgi?id=35391
>>
>> Signed-off-by: Timo Aaltonen <timo.aaltonen at canonical.com>
>> ---
>>  src/jstk.c |    7 -------
>>  1 files changed, 0 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/jstk.c b/src/jstk.c
>> index 9796a46..41cace7 100644
>> --- a/src/jstk.c
>> +++ b/src/jstk.c
>> @@ -622,13 +622,6 @@ jstkCoreUnInit(InputDriverPtr    drv,
>>  {
>>      JoystickDevPtr device = (JoystickDevPtr) pInfo->private;
>>  
>> -    if (device->keyboard_device != NULL)
>> -    {
>> -        xf86DisableDevice(device->keyboard_device->dev, TRUE);
>> -        device->keyboard_device = NULL;
>> -    }
> 
> that's not quite enough. we still support ABI 11. in theory anyway, I don't
> think either has been actually tested on a device.
> so the if condition removal should go into a ifdef ABI >= 12
> 
> alternatively, you could just up the driver to only support ABI 12. as long
> as no-one steps up to maintain it, I'm happy to keep it in lockstep with the
> server at least.

Duh, yes.. I misread the commit log. Pre-ABI 11 support was dropped
earlier, so I'll add the ifdef.

>> -
>> -    free (device);
> 
> some comment explainig _why_ this fixes the crash in the commit message
> would have been nice.
> 
> turns out that pInfo->private is shared between the keyboard device and the 
> actual device and this would cause a double free.
> 
> and the condition above is obsolete because with input ABI 12, devices that
> are hotplugged through the driver are removed by the server now.

Right, I'll make it more clear in the next version.

t



More information about the xorg-devel mailing list