Skip to content

Commit

Permalink
udl-kms: change down_interruptible to down
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: [email protected]
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
Mikulas Patocka authored and airlied committed Jul 30, 2018
1 parent acb1872 commit 8456b99
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/gpu/drm/udl/udl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,13 @@ static void udl_free_urb_list(struct drm_device *dev)
struct list_head *node;
struct urb_node *unode;
struct urb *urb;
int ret;
unsigned long flags;

DRM_DEBUG("Waiting for completes and freeing all render urbs\n");

/* keep waiting and freeing, until we've got 'em all */
while (count--) {

/* Getting interrupted means a leak, but ok at shutdown*/
ret = down_interruptible(&udl->urbs.limit_sem);
if (ret)
break;
down(&udl->urbs.limit_sem);

spin_lock_irqsave(&udl->urbs.lock, flags);

Expand Down

0 comments on commit 8456b99

Please sign in to comment.