udl-kms: change down_interruptible to down
If we leave urbs around, it causes not only leak, but also memory corruption. This patch fixes the function udl_free_urb_list, so that it always waits for all urbs that are in progress. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:

committed by
Dave Airlie

parent
acb1872577
commit
8456b99c16
@@ -170,18 +170,13 @@ static void udl_free_urb_list(struct drm_device *dev)
|
|||||||
struct list_head *node;
|
struct list_head *node;
|
||||||
struct urb_node *unode;
|
struct urb_node *unode;
|
||||||
struct urb *urb;
|
struct urb *urb;
|
||||||
int ret;
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
DRM_DEBUG("Waiting for completes and freeing all render urbs\n");
|
DRM_DEBUG("Waiting for completes and freeing all render urbs\n");
|
||||||
|
|
||||||
/* keep waiting and freeing, until we've got 'em all */
|
/* keep waiting and freeing, until we've got 'em all */
|
||||||
while (count--) {
|
while (count--) {
|
||||||
|
down(&udl->urbs.limit_sem);
|
||||||
/* Getting interrupted means a leak, but ok at shutdown*/
|
|
||||||
ret = down_interruptible(&udl->urbs.limit_sem);
|
|
||||||
if (ret)
|
|
||||||
break;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&udl->urbs.lock, flags);
|
spin_lock_irqsave(&udl->urbs.lock, flags);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user