Commit 2469d5db authored by Bernie Thompson's avatar Bernie Thompson Committed by Greg Kroah-Hartman

Staging: udlfb: Rework startup and teardown to fix race conditions

Rework probe to use refcounts and std functions

Because the different parts of the driver (usb, fbdev) tear down
in different orders, the driver previously could crash accessing
data that had already been freed.  Refcounting system used to handle.

Reworked probe to make use of refcounts, set mode using std fbops,
and set up sysfs and pre-allocated urbs.
Signed-off-by: default avatarBernie Thompson <bernie@plugable.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7d9485e2
This diff is collapsed.
......@@ -25,13 +25,14 @@ struct dlfb_data {
struct device *gdev; /* &udev->dev */
struct usb_interface *interface;
struct urb *tx_urb, *ctrl_urb;
struct usb_ctrlrequest dr;
struct fb_info *info;
struct urb_list urbs;
struct kref kref;
char *buf;
char *bufend;
char *backing_buffer;
struct delayed_work deferred_work;
struct mutex fb_open_lock;
struct mutex bulk_mutex;
int fb_count;
atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment