]> git.hungrycats.org Git - linux/commitdiff
udl-kms: change down_interruptible to down
authorMikulas Patocka <mpatocka@redhat.com>
Sun, 3 Jun 2018 14:40:55 +0000 (16:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:18:39 +0000 (09:18 +0200)
commit 8456b99c16d193c4c3b7df305cf431e027f0189c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/udl/udl_main.c

index 33dbfb2c47486ee3b7a88cc318d3e6230b4dc0f1..2d7d7e0b2a236a2ff7d65870aaa8a7c644f9fff8 100644 (file)
@@ -141,18 +141,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);