Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1827094imm; Mon, 3 Sep 2018 10:27:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYiNtjrv7MQAD+3k3u6M7Z0uvxFTKRVQoe1fCpuDVQCr3+udS6bugKlrMVe9SKMeNXmpVRE X-Received: by 2002:a63:170b:: with SMTP id x11-v6mr11252663pgl.364.1535995630265; Mon, 03 Sep 2018 10:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995630; cv=none; d=google.com; s=arc-20160816; b=jTJqjWRdR4Rl7QYF1PY+3BmiwK7vciTm4UgmFC9cl7TNwODDjjZMz1wZeDxmTm1dZ5 mJWRV0gZJPB0sjp6mEUvCaZraKargc1y3Kq/1MQQ5Sk3UuSQgEGAO+Ax0flByVEyJPzs Zfnr28/nzeaz4JuDGNE0yozsJBmSCjHOTQYme3dj4yRKGoHmswFYTOXuvR67+IiCtnr4 Uo85NDuEdltOjAbhuGbt6LfgK0rt88TOZVVtlmUunkDZpdWeFqLvTloVsdY41sheFeB+ rqgZ1GHHOR4O3gUMpH9BDOJDQDlchzHiK2ROETJPGV2K4xODlP63HZqHi3vEhgJVFHzO ONzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=b8fkxSZDFRH6Jq2c/zppsTK+B8mWq1k72N4xwESfzJo=; b=JmiOJnbm1zHScHry5gCnUfoF0nvbq4ucKN5jtH4uWvz7c2An1qY3bKYSAHe1jvtPWy zVU7d74ac6O7/RyMMtOHdop0IyjxRU825R5WlNRgVq4iueX+efjdpFXvK8Kk2oXMmdFM iZsQoWbcrHT1Abt0M5N4kIoLfwQ9fYrniVNlEfX2N3Rbq2dtswSA8Dc/9TGZMM/vvnLt UOjtz+jwJS1SI/5TR+2rUOj5Qd8EPPAtq54W+L8SCndq0XnfK4sQeJiqyqxWce2OuBPy bkxCBeU1mlQc4lsI53qUXxfaLQY3XHa79BIoeT8hv1KIK0umyavxEE5+P7W9puNWZ7SX Kzrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si17645511plz.220.2018.09.03.10.26.55; Mon, 03 Sep 2018 10:27:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730727AbeICVq7 (ORCPT + 99 others); Mon, 3 Sep 2018 17:46:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45826 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728380AbeICVq6 (ORCPT ); Mon, 3 Sep 2018 17:46:58 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D2FAED37; Mon, 3 Sep 2018 17:25:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , Dave Airlie Subject: [PATCH 4.14 125/165] udl-kms: change down_interruptible to down Date: Mon, 3 Sep 2018 18:56:51 +0200 Message-Id: <20180903165701.858089458@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikulas Patocka 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 Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/udl/udl_main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -169,18 +169,13 @@ static void udl_free_urb_list(struct drm 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);