Hi Joey,

On Wed, Oct 13, 2010 at 11:47:40AM +0800, Lee, Chun-Yi wrote:
 +
> +     status = wmi_install_notify_handler(ACERWMID_EVENT_GUID,
> +                                             acer_wmi_notify, NULL);
> +     if (ACPI_FAILURE(status)) {
> +             err = -EIO;
> +             goto err_unregister_input;
> +     }
> +
> +     return 0;
> +
> +err_unregister_input:
> +     input_unregister_device(acer_wmi_input_dev);
> +err_free_keymap:
> +     sparse_keymap_free(acer_wmi_input_dev);
> +err_free_dev:
> +     input_free_device(acer_wmi_input_dev);

If wmi_install_notify_handler() fails you'll end up doing
input_unregister_device() + input_free_device() which is forbidden. To
avoid this issue register the device after installing the handler. As
long as input device is properly allocated (by calling
input_allocate_device) it is safe to use it to send events (although
they will not go anywhere).

BTW, I think it is high time we allocate a dedicated key for touchpad
on/off....

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" 
in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to