Re: [PATCH 04/16] HID: wiimote: Add extension support stub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Sonntag, 13. November 2011, 14:27:07 schrieb David Herrmann:
> +/* Deinitializes the extension driver of a wiimote */
> +void wiiext_deinit(struct wiimote_data *wdata)
> +{
> +       struct wiimote_ext *ext = wdata->ext;
> +       unsigned long flags;
> +
> +       if (!ext)
> +               return;
> +
> +       spin_lock_irqsave(&wdata->state.lock, flags);
> +       wdata->ext = NULL;
> +       spin_unlock_irqrestore(&wdata->state.lock, flags);
> +
> +       cancel_work_sync(&ext->worker);
> +       kfree(ext);
> +}


Are you sure you are doing this in the correct order?
You are needlessly leaving a window where wdate->ext is NULL
but the worker may run.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux