From patchwork Sat Oct 22 01:17:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 7058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp985427wrr; Fri, 21 Oct 2022 18:29:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ADQonjdJu2L0BPqo49g2Fdv4kcnx1w/8sjz/O0Y0QhN5HxnIVuBB+kzqpPnSIDoUG7rAg X-Received: by 2002:a17:907:2cf1:b0:78d:c7a1:172d with SMTP id hz17-20020a1709072cf100b0078dc7a1172dmr17670603ejc.51.1666402140430; Fri, 21 Oct 2022 18:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666402140; cv=none; d=google.com; s=arc-20160816; b=afPhsvPzCI+eeqCxjw0FCoCBB+s/uLt3JNlbz4zyQ5rpeecfECMamW7unyyg0rcc4c iU7G3j7Y+TAolTk85Xoj9yehWwWox75EHIfnHPLiOX8COVOP7RNhIRVt3cY9th1Y2sOB pM+b2AED0FRjF4FXgygvdvaKlMLsMg9J+7rBkZSw+HfLTMzLMU55ie+yd8TV1W5EFoqP XPcQB3euLITLKIQvX64yq4E+aqxqMW+01p6ZEao2txXcJLLKspbYaCz+499j4QNpSuJo PrL5kjRB2C1mSUwQ1U0MSSjAUvhlSR6sAfi2uIQb104BXgwG0AbgtCHYbdeD1glm1HT7 mH7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=tZefhSa6h6/2FyZRC24yBQDBKDQ8PvrvDoOubmvzYns=; b=CSxVETDN3D1G5FY5qvSdqjGtk6mIpzTOJf/Fr97BxngcrjfhnkntfspJ1HXdTqIfId V2OcSnTLQmMocwFlM02C/Fvd8FvtpMOe5M+dHsg+qLXW7OrDXt6ErWu/Af8CKy8TQk5V dQ46X8fdFCA0ORAtqOsMvtN48SDnfMfJWHQjEgZ5KhcX67cMBeHEzksscSIG85cB954W P7rdkeFeR4RcCXv8v5O8AkryXSDub0OI3TyX2JxtB9RLTu55JR4Wam64WrWVXpTimRWV wLk69TY+j1gC+LE7Fo8vl4t/fiZVNVYTSMprf0cGIb1FYdZIQdsINBWDxTl33fAiN9ga bzuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a056402274b00b0044711ea363esi24938148edd.21.2022.10.21.18.28.35; Fri, 21 Oct 2022 18:29:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbiJVBXs (ORCPT + 99 others); Fri, 21 Oct 2022 21:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbiJVBXj (ORCPT ); Fri, 21 Oct 2022 21:23:39 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 809152B2E3D; Fri, 21 Oct 2022 18:23:38 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MvNnd2YPdzJn6v; Sat, 22 Oct 2022 09:20:53 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 09:23:35 +0800 Received: from huawei.com (10.67.165.24) by dggpeml100012.china.huawei.com (7.185.36.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 09:23:35 +0800 From: Kai Ye To: CC: , , Subject: [PATCH v3 1/3] crypto: hisilicon/qm - increase the memory of local variables Date: Sat, 22 Oct 2022 01:17:44 +0000 Message-ID: <20221022011746.27197-2-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221022011746.27197-1-yekai13@huawei.com> References: <20221022011746.27197-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml100012.china.huawei.com (7.185.36.121) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747349290922785653?= X-GMAIL-MSGID: =?utf-8?q?1747349290922785653?= Increase the buffer to prevent stack overflow by fuzz test. The maximum length of the qos configuration buffer is 256 bytes. Currently, the value of the 'val buffer' is only 32 bytes. The sscanf does not check the dest memory length. So the 'val buffer' may stack overflow. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/qm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index e3edb176d976..5d79e9f0e7e1 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -250,7 +250,6 @@ #define QM_QOS_MIN_CIR_B 100 #define QM_QOS_MAX_CIR_U 6 #define QM_QOS_MAX_CIR_S 11 -#define QM_QOS_VAL_MAX_LEN 32 #define QM_DFX_BASE 0x0100000 #define QM_DFX_STATE1 0x0104000 #define QM_DFX_STATE2 0x01040C8 @@ -4612,7 +4611,7 @@ static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf, unsigned int *fun_index) { char tbuf_bdf[QM_DBG_READ_LEN] = {0}; - char val_buf[QM_QOS_VAL_MAX_LEN] = {0}; + char val_buf[QM_DBG_READ_LEN] = {0}; u32 tmp1, device, function; int ret, bus; From patchwork Sat Oct 22 01:17:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 7057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp985398wrr; Fri, 21 Oct 2022 18:28:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6TPETIc2QPIlL1NWBGdgagN5kUNm9JsL8yHirMty3RjfXgsHOjBAyP/6jNG9R93qK+2621 X-Received: by 2002:a05:6402:8cc:b0:45c:a5c9:c0a with SMTP id d12-20020a05640208cc00b0045ca5c90c0amr19855435edz.135.1666402134957; Fri, 21 Oct 2022 18:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666402134; cv=none; d=google.com; s=arc-20160816; b=E38I9WjVpV7oIdlCay/HY3fVuuTpozh43UzYBrPIhe1srN0VTwmEzjayImYezUpPg3 idGQ1bGOU0sPyA164kqXcfb7H2hJw1brIU6OFYJkIS9+U7zTQ1JCtaaV5TguFIi9M+id knwQKD1iQtV+z7v9wWWvIPcURXqanejPjZxPRnAzwcDZhgySQl7WVCei6zUy8kG1l16f aGx20PxY5UQmSxkA+Blas7ZxrV0O4FaGI2Vd6gFRAPboJqdVkEcFmu0i+qTCDpOIjX7d tB+debhibHXlnU9/KyoIK5ydJgXrDvr5quLRhjYumgWPSCPlJ6bMAEEiGzXhaPZK9cBD 3ksQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=KCyMXomirBhNE+PGYaW2ctJtm3ZZvMGDsppN/at8JsU=; b=CzxG4MKy5lMql6S7FgyR6f2JQ8J9unwuusR/JiQhngIoOZoHWWSLpoNSE0OV3QU6vM jMvmM0kWCtYLGKWoIbF5FGMxvmub1ipMJzTWhM3R5Qwrk3wYfYLyhof42h77AbydK7zS mpbM1UE+5mhmZC4Rx4k1501nIbqe641hhObMP92DAmvZ9PR9V+rZr9jFS+eWtm/fT/ph +XezfDoHKp6XoVhn2tcBsmrIyqpuCuoHOYlXLPo9Jz21juiLgVQiZGvuX0COZmIvFokY MX3UuXa0rMbYfvYkCZ9dj5MQ0uxdeo+2wBDUeWIFaPMao7PfnDD+GaDFKWlTxfVygaBZ 2iRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go12-20020a1709070d8c00b0078e319dcca7si19830883ejc.744.2022.10.21.18.28.29; Fri, 21 Oct 2022 18:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbiJVBXq (ORCPT + 99 others); Fri, 21 Oct 2022 21:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbiJVBXj (ORCPT ); Fri, 21 Oct 2022 21:23:39 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22ED32B3200; Fri, 21 Oct 2022 18:23:38 -0700 (PDT) Received: from dggpeml500025.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MvNmt20l4zpVfr; Sat, 22 Oct 2022 09:20:14 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500025.china.huawei.com (7.185.36.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 09:23:35 +0800 Received: from huawei.com (10.67.165.24) by dggpeml100012.china.huawei.com (7.185.36.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 09:23:35 +0800 From: Kai Ye To: CC: , , Subject: [PATCH v3 2/3] crypto: hisilicon/qm - add pci bdf number check Date: Sat, 22 Oct 2022 01:17:45 +0000 Message-ID: <20221022011746.27197-3-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221022011746.27197-1-yekai13@huawei.com> References: <20221022011746.27197-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml100012.china.huawei.com (7.185.36.121) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747349284845832460?= X-GMAIL-MSGID: =?utf-8?q?1747349284845832460?= The pci bdf number check is added for qos written by using the pci api. Directly get the devfn by pci_dev, so delete some redundant code. And use the kstrtoul instead of sscanf to simplify code. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/qm.c | 37 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 5d79e9f0e7e1..80eeb966cf89 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -4589,49 +4589,36 @@ static ssize_t qm_algqos_read(struct file *filp, char __user *buf, return ret; } -static ssize_t qm_qos_value_init(const char *buf, unsigned long *val) -{ - int buflen = strlen(buf); - int ret, i; - - for (i = 0; i < buflen; i++) { - if (!isdigit(buf[i])) - return -EINVAL; - } - - ret = sscanf(buf, "%lu", val); - if (ret != QM_QOS_VAL_NUM) - return -EINVAL; - - return 0; -} - static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf, unsigned long *val, unsigned int *fun_index) { + struct bus_type *bus_type = qm->pdev->dev.bus; char tbuf_bdf[QM_DBG_READ_LEN] = {0}; char val_buf[QM_DBG_READ_LEN] = {0}; - u32 tmp1, device, function; - int ret, bus; + struct pci_dev *pdev; + struct device *dev; + int ret; ret = sscanf(buf, "%s %s", tbuf_bdf, val_buf); if (ret != QM_QOS_PARAM_NUM) return -EINVAL; - ret = qm_qos_value_init(val_buf, val); + ret = kstrtoul(val_buf, 10, val); if (ret || *val == 0 || *val > QM_QOS_MAX_VAL) { pci_err(qm->pdev, "input qos value is error, please set 1~1000!\n"); return -EINVAL; } - ret = sscanf(tbuf_bdf, "%u:%x:%u.%u", &tmp1, &bus, &device, &function); - if (ret != QM_QOS_BDF_PARAM_NUM) { - pci_err(qm->pdev, "input pci bdf value is error!\n"); - return -EINVAL; + dev = bus_find_device_by_name(bus_type, NULL, tbuf_bdf); + if (!dev) { + pci_err(qm->pdev, "input pci bdf number is error!\n"); + return -ENODEV; } - *fun_index = PCI_DEVFN(device, function); + pdev = container_of(dev, struct pci_dev, dev); + + *fun_index = pdev->devfn; return 0; } From patchwork Sat Oct 22 01:17:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 7056 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp984580wrr; Fri, 21 Oct 2022 18:26:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM467LX38r1hKXjRPu8r6lkch+UoGSdEJNK1b7EMCZzKK/ObTdQTWtQXJ8NdHJLGExzOVMJy X-Received: by 2002:a05:6402:2201:b0:44f:443e:2a78 with SMTP id cq1-20020a056402220100b0044f443e2a78mr19781499edb.76.1666401971808; Fri, 21 Oct 2022 18:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666401971; cv=none; d=google.com; s=arc-20160816; b=Opip/m3W8LvHu5I8AmOOv7FT5Tpz50aUe45j37P3AtvIu4GD2kLUlmiGgnf/kA0ASM Bnurx9OpKO+VIpCT58lUdGNzxagEYrOrYgH4Z5uqPhASd75lQUhmNaYf5hXFyGWqtYDX kaG0l6JGr1bvwiW5LT5J0BGycoMIA/9xWe0Rlui89ny4yi+vylz0rdtM7CD6i6UIn3ex mFjokq0limHOBee3sq0ck1yZ+lHldNEpdS09IDK+7Fd+KteKEdzSL//K3pfL6vZtXJi1 Jc3sA5TYR3K4LnNzQVho0BnVZJICk0Y2EDvO2xyzzgEY86btygvDhJ6L/RKmR5oRTJaM jCKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=thi3XuDv5vw8t+0z3omISxYNIexCY4+Q50HY9zNJ5rQ=; b=VKJWFluLkkQ1fP1edxTnDBQny6stZN97Gcn7rP5a9oVGQcmgau2U2Zbyx9fLvctPpj pb6Qt4NgJaYW+E36QEWVOuihc5/ynRani5Cmb3GOgS22ge9PgvsGC4Xly7Y2tx3YJWI2 r06Domq5JAH2KonI6FzF1Kj8kaz6xBORvor9GSH6vGtLlcuOopUnb+do6t3NWIcWrOxE at+0ov2L+q2RT944G7J1eAxsAMyhV1HveA76KuR30ErVGcFT6aEc5p9UkySvMLxDdrd5 637fczcEm69EPtacX1TLhb6xov+S6A9XaKTZ91gUw2J4iPqCaCwCMG9PJSH/laGE6EBU nSeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb6-20020a1709071c8600b0078d949dfbfesi23145857ejc.71.2022.10.21.18.25.47; Fri, 21 Oct 2022 18:26:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbiJVBXl (ORCPT + 99 others); Fri, 21 Oct 2022 21:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbiJVBXi (ORCPT ); Fri, 21 Oct 2022 21:23:38 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20E542B2E3D; Fri, 21 Oct 2022 18:23:37 -0700 (PDT) Received: from dggpeml500025.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MvNrZ2wGHzHvD2; Sat, 22 Oct 2022 09:23:26 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500025.china.huawei.com (7.185.36.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 09:23:35 +0800 Received: from huawei.com (10.67.165.24) by dggpeml100012.china.huawei.com (7.185.36.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 09:23:35 +0800 From: Kai Ye To: CC: , , Subject: [PATCH v3 3/3] crypto: hisilicon/qm - delete redundancy check Date: Sat, 22 Oct 2022 01:17:46 +0000 Message-ID: <20221022011746.27197-4-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221022011746.27197-1-yekai13@huawei.com> References: <20221022011746.27197-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml100012.china.huawei.com (7.185.36.121) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747349114110406555?= X-GMAIL-MSGID: =?utf-8?q?1747349114110406555?= Because the permission on the VF debugfs file is "0444". So the VF function checking is redundant in qos writing api. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/qm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 80eeb966cf89..363a02810a16 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -4632,9 +4632,6 @@ static ssize_t qm_algqos_write(struct file *filp, const char __user *buf, unsigned long val; int len, ret; - if (qm->fun_type == QM_HW_VF) - return -EINVAL; - if (*pos != 0) return 0;