From nobody Thu Oct 2 13:03:49 2025 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06EA72C11D1; Tue, 16 Sep 2025 14:48:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034104; cv=none; b=coucXooNGebrpJq8+khJX3uahqOA0jzCUIzNqiL+U3GbzQ15APP0VQ6rR0Kgq3iCJbe80dVvEmJzTEv/R+ce8fxl3cNGnrt6IH8sUNXfeuYAM0ePdC/31l+/xH2qd7gQ2PHYW+2DHpl66ZpxDgkR0gYL4vxCT2GO+1RWbWQFkAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034104; c=relaxed/simple; bh=rtkIifI4CZFXQgWdW+YG4CepKxWjk2qQHcliol8lIfE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BMRqaQUMUzPoz5q0FXtNlEnNnmbdP+/vjd2vJrIXN1fNEMjUs7eE0xXwrN5SWDFHGERQ3956jd1uPvo6e+CJkTqZvLMfaezyQg27FJmMwZ95N8fgp2BbizibYg9ooBiK98QqOqObaOjcf7Gi7YBSrCXkKuYB+2cm/zsnGI1/8tg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4cR4S20WZqz24jBn; Tue, 16 Sep 2025 22:44:50 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id 7ED5818005F; Tue, 16 Sep 2025 22:48:13 +0800 (CST) Received: from kwepemq200001.china.huawei.com (7.202.195.16) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:13 +0800 Received: from localhost.huawei.com (10.90.31.46) by kwepemq200001.china.huawei.com (7.202.195.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:12 +0800 From: Chenghai Huang To: , , CC: , , , , , , Subject: [PATCH v2 1/4] uacce: fix for cdev memory leak Date: Tue, 16 Sep 2025 22:48:08 +0800 Message-ID: <20250916144811.1799687-2-huangchenghai2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250916144811.1799687-1-huangchenghai2@huawei.com> References: <20250916144811.1799687-1-huangchenghai2@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To kwepemq200001.china.huawei.com (7.202.195.16) Content-Type: text/plain; charset="utf-8" From: Wenkai Lin If cdev_device_add failed, it is hard to determine whether cdev_del has been executed, which lead to a memory leak issue, so we use cdev_init to avoid it. Fixes: 015d239ac014 ("uacce: add uacce driver") Cc: stable@vger.kernel.org Signed-off-by: Wenkai Lin Signed-off-by: Chenghai Huang --- drivers/misc/uacce/uacce.c | 13 ++++--------- include/linux/uacce.h | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 42e7d2a2a90c..12370469f646 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -522,14 +522,10 @@ int uacce_register(struct uacce_device *uacce) if (!uacce) return -ENODEV; =20 - uacce->cdev =3D cdev_alloc(); - if (!uacce->cdev) - return -ENOMEM; - - uacce->cdev->ops =3D &uacce_fops; - uacce->cdev->owner =3D THIS_MODULE; + cdev_init(&uacce->cdev, &uacce_fops); + uacce->cdev.owner =3D THIS_MODULE; =20 - return cdev_device_add(uacce->cdev, &uacce->dev); + return cdev_device_add(&uacce->cdev, &uacce->dev); } EXPORT_SYMBOL_GPL(uacce_register); =20 @@ -568,8 +564,7 @@ void uacce_remove(struct uacce_device *uacce) unmap_mapping_range(q->mapping, 0, 0, 1); } =20 - if (uacce->cdev) - cdev_device_del(uacce->cdev, &uacce->dev); + cdev_device_del(&uacce->cdev, &uacce->dev); xa_erase(&uacce_xa, uacce->dev_id); /* * uacce exists as long as there are open fds, but ops will be freed diff --git a/include/linux/uacce.h b/include/linux/uacce.h index e290c0269944..98b896192a44 100644 --- a/include/linux/uacce.h +++ b/include/linux/uacce.h @@ -126,7 +126,7 @@ struct uacce_device { bool is_vf; u32 flags; u32 dev_id; - struct cdev *cdev; + struct cdev cdev; struct device dev; struct mutex mutex; void *priv; --=20 2.33.0 From nobody Thu Oct 2 13:03:49 2025 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABC5A2C11D1; Tue, 16 Sep 2025 14:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034100; cv=none; b=tKq02GNEQ8tVHIJklO8h2rmHQZzdp5zmeFUfiWtTu6JxjjKezVEBSWsz9vPIWU3ErIayhrwdWeA5wF1XuHEJtWUqFuWctTF5+srWIxK9bw22w+BSCkaiQQn+vrJm1K1b4cfZ3Ygnd5pT3R9GVcEbJGYbYiKfDFxsRwBov1FKipE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034100; c=relaxed/simple; bh=XFs81zs95XIBVvri2eZ/XJYmLVRQG8ik0skygWDFaAA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gA5z8WIpuUdud5Yri80eyYopfBDVikv7IU6NSi5ZgLCnOPT9lRgxgz52GYUx0mcPqUOW82Ol4e3rX7xOeYbPruuKXT9bsLiTikAkyDp2g6wOEzOQGxK26SXu52/tWXWyUNTpI7fOCuM0qIi/uWV4cRqh1O4klqvoswh2ig3m/Wg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4cR4R93tNRz13NhQ; Tue, 16 Sep 2025 22:44:05 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 1A450180485; Tue, 16 Sep 2025 22:48:14 +0800 (CST) Received: from kwepemq200001.china.huawei.com (7.202.195.16) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:13 +0800 Received: from localhost.huawei.com (10.90.31.46) by kwepemq200001.china.huawei.com (7.202.195.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:13 +0800 From: Chenghai Huang To: , , CC: , , , , , , Subject: [PATCH v2 2/4] uacce: fix isolate sysfs check condition Date: Tue, 16 Sep 2025 22:48:09 +0800 Message-ID: <20250916144811.1799687-3-huangchenghai2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250916144811.1799687-1-huangchenghai2@huawei.com> References: <20250916144811.1799687-1-huangchenghai2@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To kwepemq200001.china.huawei.com (7.202.195.16) Content-Type: text/plain; charset="utf-8" The uacce supports device isolation feature. If the driver implements the isolate_err_threshold_read and isolate_err_threshold_write callbacks, the uacce will create sysfs files. Users can read and configure isolation policies through sysfs. Currently, if either isolate_err_threshold_read or isolate_err_threshold_write callback exists, sysfs files are created. However, accessing a non-existent callback may cause a system panic. Therefore, sysfs files are only created when both isolate_err_threshold_read and isolate_err_threshold_write are present. Fixes: e3e289fbc0b5 ("uacce: supports device isolation feature") Cc: stable@vger.kernel.org Signed-off-by: Chenghai Huang --- drivers/misc/uacce/uacce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 12370469f646..770a931ef68d 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -441,7 +441,7 @@ static umode_t uacce_dev_is_visible(struct kobject *kob= j, return 0; =20 if (attr =3D=3D &dev_attr_isolate_strategy.attr && - (!uacce->ops->isolate_err_threshold_read && + (!uacce->ops->isolate_err_threshold_read || !uacce->ops->isolate_err_threshold_write)) return 0; =20 --=20 2.33.0 From nobody Thu Oct 2 13:03:49 2025 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 324F8194A73; Tue, 16 Sep 2025 14:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034101; cv=none; b=PWvPXsIs7l1axw1qHwRKf3oi9n2mfH/tqkvIuRlYc8joh4av30UMnwUtIZJF4SkfqVOOfnImzhR3Ru/S98/RBfVpHTuf4aeIi/u0l1e2Mpb01HGhQ2EpSnLqn6x1l0ZhdIuXmf46yj1fTw4XDjlYsb/YyE+IA6VlaHuJJP5XNuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034101; c=relaxed/simple; bh=oyU8qiw51dSJYMBKtoP/7t+jedY7k8+d7PdF3tyLLVs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tZJnkLvq0DlGPAmXBVgMm2EU4ZQDD2iBHC1CqHMsWQzIkTebDldfX777tIkT1q1Mykj45w/LSVnO7VkwNRfAuBKpxQuSO1mCxwKpla9rzhlKyOm37EdlwdBnckPeMJC0e6hdso5sknjieH3l9kHJCxTZk14aKCvJt3AsUUZIpdo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4cR4Qd12XgzTgqY; Tue, 16 Sep 2025 22:43:37 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 89EC41402E9; Tue, 16 Sep 2025 22:48:14 +0800 (CST) Received: from kwepemq200001.china.huawei.com (7.202.195.16) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:14 +0800 Received: from localhost.huawei.com (10.90.31.46) by kwepemq200001.china.huawei.com (7.202.195.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:13 +0800 From: Chenghai Huang To: , , CC: , , , , , , Subject: [PATCH v2 3/4] uacce: implement mremap in uacce_vm_ops to return -EPERM Date: Tue, 16 Sep 2025 22:48:10 +0800 Message-ID: <20250916144811.1799687-4-huangchenghai2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250916144811.1799687-1-huangchenghai2@huawei.com> References: <20250916144811.1799687-1-huangchenghai2@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To kwepemq200001.china.huawei.com (7.202.195.16) Content-Type: text/plain; charset="utf-8" From: Yang Shen The current uacce_vm_ops does not support the mremap operation of vm_operations_struct. Implement .mremap to return -EPERM to remind users. The reason we need to explicitly disable mremap is that when the driver does not implement .mremap, it uses the default mremap method. This could lead to a risk scenario: An application might first mmap address p1, then mremap to p2, followed by munmap(p1), and finally munmap(p2). Since the default mremap copies the original vma's vm_private_data (i.e., q) to the new vma, both munmap operations would trigger vma_close, causing q->qfr to be freed twice(qfr will be set to null here, so repeated release is ok). Fixes: 015d239ac014 ("uacce: add uacce driver") Cc: stable@vger.kernel.org Signed-off-by: Yang Shen Signed-off-by: Chenghai Huang --- drivers/misc/uacce/uacce.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 770a931ef68d..dda71492874d 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -214,8 +214,14 @@ static void uacce_vma_close(struct vm_area_struct *vma) } } =20 +static int uacce_vma_mremap(struct vm_area_struct *area) +{ + return -EPERM; +} + static const struct vm_operations_struct uacce_vm_ops =3D { .close =3D uacce_vma_close, + .mremap =3D uacce_vma_mremap, }; =20 static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma) --=20 2.33.0 From nobody Thu Oct 2 13:03:49 2025 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5FDA34DCC9; Tue, 16 Sep 2025 14:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034104; cv=none; b=LDH4QmwqFHLxCHs4ckDzgiaq/O+LnMXjYFcHm4ipR12pofXCgOcPYSym7+wW8nDkTnapEOFc1nF7VC3G2qTlEjWgrwUFHJjKyqGccdUMqbVlxWfsB3xaY9/GjXYFeRQVLzxGvwuKFSaxT4ziRlMU4gdi/hV6lbWGk1lZOe7CjNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758034104; c=relaxed/simple; bh=w0w79QuH03O5fJNpf4eWNB1b0fET3TvDehwPRJX1QCU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G6xPz36LDThgR7YYVAt+7UOfknf0zBbiy0o0nkDHntvjOhU+veOdN0sPsARBPf5aByZPw6lMJPVhTeaFDK25/mz+LzrcO2yLEFJpi0OaAoc3JTbyZbuEmWClgAb3vg9KMN5ebcgsymfm7IYbZywBhNXFDkbh/UXeST1InEvwfK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4cR4S34TD2z24jCw; Tue, 16 Sep 2025 22:44:51 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id 105EE140275; Tue, 16 Sep 2025 22:48:15 +0800 (CST) Received: from kwepemq200001.china.huawei.com (7.202.195.16) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:14 +0800 Received: from localhost.huawei.com (10.90.31.46) by kwepemq200001.china.huawei.com (7.202.195.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 22:48:14 +0800 From: Chenghai Huang To: , , CC: , , , , , , Subject: [PATCH v2 4/4] uacce: ensure safe queue release with state management Date: Tue, 16 Sep 2025 22:48:11 +0800 Message-ID: <20250916144811.1799687-5-huangchenghai2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250916144811.1799687-1-huangchenghai2@huawei.com> References: <20250916144811.1799687-1-huangchenghai2@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To kwepemq200001.china.huawei.com (7.202.195.16) Content-Type: text/plain; charset="utf-8" Directly calling `put_queue` carries risks since it cannot guarantee that resources of `uacce_queue` have been fully released beforehand. So adding a `stop_queue` operation for the UACCE_CMD_PUT_Q command and leaving the `put_queue` operation to the final resource release ensures safety. Queue states are defined as follows: - UACCE_Q_ZOMBIE: Initial state - UACCE_Q_INIT: After opening `uacce` - UACCE_Q_STARTED: After `start` is issued via `ioctl` When executing `poweroff -f` in virt while accelerator are still working, `uacce_fops_release` and `uacce_remove` may execute concurrently. This can cause `uacce_put_queue` within `uacce_fops_release` to access a NULL `ops` pointer. Therefore, add state checks to prevent accessing freed pointers. Fixes: 015d239ac014 ("uacce: add uacce driver") Cc: stable@vger.kernel.org Signed-off-by: Chenghai Huang Signed-off-by: Yang Shen --- drivers/misc/uacce/uacce.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index dda71492874d..ff9c515ac289 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -40,20 +40,34 @@ static int uacce_start_queue(struct uacce_queue *q) return 0; } =20 -static int uacce_put_queue(struct uacce_queue *q) +static int uacce_stop_queue(struct uacce_queue *q) { struct uacce_device *uacce =3D q->uacce; =20 - if ((q->state =3D=3D UACCE_Q_STARTED) && uacce->ops->stop_queue) + if (q->state !=3D UACCE_Q_STARTED) + return 0; + + if (uacce->ops->stop_queue) uacce->ops->stop_queue(q); =20 - if ((q->state =3D=3D UACCE_Q_INIT || q->state =3D=3D UACCE_Q_STARTED) && - uacce->ops->put_queue) + q->state =3D UACCE_Q_INIT; + + return 0; +} + +static void uacce_put_queue(struct uacce_queue *q) +{ + struct uacce_device *uacce =3D q->uacce; + + uacce_stop_queue(q); + + if (q->state !=3D UACCE_Q_INIT) + return; + + if (uacce->ops->put_queue) uacce->ops->put_queue(q); =20 q->state =3D UACCE_Q_ZOMBIE; - - return 0; } =20 static long uacce_fops_unl_ioctl(struct file *filep, @@ -80,7 +94,7 @@ static long uacce_fops_unl_ioctl(struct file *filep, ret =3D uacce_start_queue(q); break; case UACCE_CMD_PUT_Q: - ret =3D uacce_put_queue(q); + ret =3D uacce_stop_queue(q); break; default: if (uacce->ops->ioctl) --=20 2.33.0