Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3419504pxf; Mon, 29 Mar 2021 01:30:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoJ1c2QqMi0qCy1XxIampbuR0+P/gPbl6Y5TG1EldFgx1YDF8YafRkuVCTEnL1Nnf2j+c4 X-Received: by 2002:a17:907:7699:: with SMTP id jv25mr26521346ejc.363.1617006643684; Mon, 29 Mar 2021 01:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006643; cv=none; d=google.com; s=arc-20160816; b=ujalijmwEQ0wpya6/s0Os8GDVAyxiFDeFfdKHjoDiN7/z/gbRLjJ+vr3rEi3IPywt8 jamT/1ShUNoYJRJEVJL7Edi9ohl5qzsOOWfP7ruNSUpNlIZwR79rOahRwt0ka+W1KRnu 671aFJbN2n25RvAZ7ZkQnhUgECtuMmePvJGVR0vbJaC0g73+VGIZsVrYXvqodA3ISTBi FxdVuO5B9nAM00e+2Gr8MfwshMfkemTWIRvGIqRTTuggdJ0k10Cv0Y4DH6IpML4+ck55 90EkPyE5ZbnjfQIqwsQiMDNZZEd0HTLOAYPbCSd+6VcJjOSpWpUfL9nezSkO3nHfGv+k Fn0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T32TXkO/jxUGaagQqEs7CzyP/Q7XIS+27SXcoZ4B/0o=; b=p3kKYhJSPyH02o9ztGWeC0SoJBijPZEwAeTy0p8+HXfldivKs4CWsBDq8wesvlUrxK MhC82YRYb9XCU7co/8IuNmGtDcFo9VeGociYbvC/UG1BRPlwHfUbpzS0LWo9kUeVCSvx h/Knjm0giPTS3sxiBmMx8nufIQry4aD1NVQgyUb6u9Bj0syAL/1KpnUNh5Zo7A0vIPGP 2zFFpWEQ6gnQ0JldnsNro7yqnBLueEBff1qmx3WETl82v4ob9b5CbXBS2N5nCGX9Nee1 F4unwN8TpgbZR2ub4+nI0GShWnjOmCu8d/zdF6jA/9Cq7QsMFfb9zKBJ0+5BtQm536P1 MgYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="aAPf/te1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si13438192edt.42.2021.03.29.01.30.20; Mon, 29 Mar 2021 01:30:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="aAPf/te1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234409AbhC2I2U (ORCPT + 99 others); Mon, 29 Mar 2021 04:28:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232096AbhC2IRx (ORCPT ); Mon, 29 Mar 2021 04:17:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C24AA619BC; Mon, 29 Mar 2021 08:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005873; bh=/SitrvpyUyCwRki7AuWdCq+gcKpng8J8SHWwEbrfjJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aAPf/te1uhiuUKxoV5XSulNdSEEJk+bQt8ikUDf2Ogqem33jMOz14SXCZn4Qu7Rrb 63EQGASvfP7dh5TWWz91uB6ynCBmAUDSx76tieZDN8wo0Y2RzQIh8bERw+DSSEZYZc 0ERBPzu8Hx6tQMLi9cnplsniH8IERstflPgMgfR4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomer Tayar , Oded Gabbay , Sasha Levin Subject: [PATCH 5.10 036/221] habanalabs: Call put_pid() when releasing control device Date: Mon, 29 Mar 2021 09:56:07 +0200 Message-Id: <20210329075630.374152190@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomer Tayar [ Upstream commit 27ac5aada024e0821c86540ad18f37edadd77d5e ] The refcount of the "hl_fpriv" structure is not used for the control device, and thus hl_hpriv_put() is not called when releasing this device. This results with no call to put_pid(), so add it explicitly in hl_device_release_ctrl(). Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/misc/habanalabs/common/device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index 71b3a4d5adc6..7b0bf470795c 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -106,6 +106,8 @@ static int hl_device_release_ctrl(struct inode *inode, struct file *filp) list_del(&hpriv->dev_node); mutex_unlock(&hdev->fpriv_list_lock); + put_pid(hpriv->taskpid); + kfree(hpriv); return 0; -- 2.30.1