From patchwork Fri Oct 14 09:38:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 2623 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp89055wrs; Fri, 14 Oct 2022 02:48:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6lWWAREagjJMp5vDrhZK7JjpExmKASiGTVfF3YWMGQShdGdIQlsyC6TsIG/2pb0AF4Zvoe X-Received: by 2002:a17:907:d22:b0:78e:2788:51ae with SMTP id gn34-20020a1709070d2200b0078e278851aemr1010778ejc.689.1665740902719; Fri, 14 Oct 2022 02:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665740902; cv=none; d=google.com; s=arc-20160816; b=i7CD2mSHIMpzFBHZBHCjanN+UScRD1AWc+/h8kRvKjE6FQ7P87/Xk7sx3JmoaXKZEH szVzQqS8Xc0BcaaybOvyxNm948wulyGOULNEAlHmDaWhXt4b9SnHE3NQ21rurEOt4YLP yyVStEjGkX44IkA4BfyD7jxW02p14PfRrJk+srcn/umvHTzQIsrBN1h7O0HvcsbTZ8vc ZYxahlzTXHKQbqtfAm7x0YJiD6WXEBD3gxq6f/xKPvD1OBtq0DgAIDKb7h+7rgoImDzL 4iNj6y6lda82p+8Vl3R7HaZ+8birChC8qvvpY+ercfxYu3bkHMhWhzkKfFobGw9UF7WT QFwQ== 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=MwEdD/OSR4bTAmXWEe3j/62fPgklC6k6O37qs6FTRh4=; b=jOf6YD/xQHbfhylLeIiYrTGcGXbLvDsqjZsBDUpm+vxCaXh2W9AjHA3jW+DPK9tFsA jOiwXykGwSpB1YgDUK3P9amUTyFHE83EoBTZGADJceB8R3ADVDPHhrk1tChPA0f2WWop sHk+VoyATf2gzSeVJJFOlvo/HbWsNif4NMW/V2UMvDh/wXD5DsW2d6QgvQMBysCZ7DdB 9mCad8DSV/orCZ7YRnvqGd+VFt93Yxd+VKAv7e8BEEIUu80D6V3+lVgJAHtj5fLathou +0K3m+3ET+m7MRCj49iAEhHZkxwsj+wU9sA9rm3CgU3FmqelqnBwJtIDYgxQAeNPbaMf SCSg== 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 e19-20020a056402089300b00458cbb6b6easi1734521edy.167.2022.10.14.02.47.55; Fri, 14 Oct 2022 02:48:22 -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 S229953AbiJNJnz (ORCPT + 99 others); Fri, 14 Oct 2022 05:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiJNJnu (ORCPT ); Fri, 14 Oct 2022 05:43:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C5661C25C2; Fri, 14 Oct 2022 02:43:50 -0700 (PDT) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MphKY6QV0zHvMZ; Fri, 14 Oct 2022 17:43:45 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 17:43:48 +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; Fri, 14 Oct 2022 17:43:48 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH 1/3] crypto: hisilicon/qm - increase the memory of local variables Date: Fri, 14 Oct 2022 09:38:05 +0000 Message-ID: <20221014093807.3101-2-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221014093807.3101-1-yekai13@huawei.com> References: <20221014093807.3101-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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?1746655932769042408?= X-GMAIL-MSGID: =?utf-8?q?1746655932769042408?= Increase the buffer to prevent stack overflow by fuzz test. 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 8b387de69d22..335e58018a31 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 @@ -4614,7 +4613,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 Fri Oct 14 09:38:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 2625 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp89681wrs; Fri, 14 Oct 2022 02:50:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM54rVOhjPVaMZ2pFlfL5j9aVf8xx3+jIrXJ1HeQaZONOdEBC8q6aF4dqU5ArHXNrGyH4VuR X-Received: by 2002:a17:90b:1b4c:b0:20d:70d8:1491 with SMTP id nv12-20020a17090b1b4c00b0020d70d81491mr16262471pjb.3.1665741009570; Fri, 14 Oct 2022 02:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665741009; cv=none; d=google.com; s=arc-20160816; b=jkxxe1rIiIQoa+5obxLwpmSnYWemI+uLg8R8ECFNmn/lmy0u4Gp6R4tKoWS02gvdY5 trgSX9GKZ5xWUHMkwRM+zMG+ue2JYefF4DWmm2gt8i3bHpU+DEzc23B5MuqHnYfALeSj 0Xpw9fThRgzDKdO6I2zATCt8sSlo7Uv4x9FR1AcshXC5+BOf6NonCDjYmUKqr1gg4dEY gKzqAJFkS/dktjCufdUUW8Cfw4KHcUUUBm7iC10mYPQHEq9TKyCFsoBzS/9uQ75HFO5u K0JMFfjoRqfQuX5PAxnaq3icK26SJ9QiRHFX/IX5CIL2iarSc/HaFCK3HinPag3FMiMo I2gQ== 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=DpFzI98i5WVAd9cmiTjagtGyU2+V4l2m+7U8Sg79/7o=; b=rDrdWvkYl+FFRTxjdlro6UjwkWGxAKKLM8RI/ldR9nMBwhp5xltvkM6EmhYhMcTm7L fGm5bLfd/dhkb6t85hf2GT23o/tnrqDVCHskOwe48C4eV6hAVo+FSHx3kbIWXrdbx+CL HIr/v0LqpMR0ovi1x/e92cmdZMVnwjqwei5E7r+cULF/e4pFtcS1NoeRtb38E8m4OT2P DPBOXJkjctnYGQAPiL7huI4Xxh+XF+EroSS7m5iUKkKCNKJGVlla+PuAQTx5WsMHsXQ9 wRaPOexZJY1hUKSakoQDgXU1j+NBI/scOiyl6iypHJDDL6/9a+oUwZGJMl3I71Sdb8NR 6sxw== 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 t8-20020a170902e84800b0017f863024acsi2762980plg.235.2022.10.14.02.49.55; Fri, 14 Oct 2022 02:50:08 -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 S229919AbiJNJoF (ORCPT + 99 others); Fri, 14 Oct 2022 05:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiJNJnv (ORCPT ); Fri, 14 Oct 2022 05:43:51 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DAD114DF3F; Fri, 14 Oct 2022 02:43:50 -0700 (PDT) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MphDH4vnYz1P7RV; Fri, 14 Oct 2022 17:39:11 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 17:43:48 +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; Fri, 14 Oct 2022 17:43:48 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH 2/3] crypto: hisilicon/qm - add pci bdf number check Date: Fri, 14 Oct 2022 09:38:06 +0000 Message-ID: <20221014093807.3101-3-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221014093807.3101-1-yekai13@huawei.com> References: <20221014093807.3101-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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?1746656044253053165?= X-GMAIL-MSGID: =?utf-8?q?1746656044253053165?= The pci bdf number check is added for qos written by using the pci api. 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 335e58018a31..661cc964e2eb 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -4591,49 +4591,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 Fri Oct 14 09:38:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 2622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp89033wrs; Fri, 14 Oct 2022 02:48:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Xb1N6WAmzT96p2EyaR8HHMqwcibWDLduma43K8O53cVJiJUneKiuF43SYlSBJw5yxFnUo X-Received: by 2002:a17:902:c405:b0:181:2355:68ea with SMTP id k5-20020a170902c40500b00181235568eamr4547046plk.70.1665740899884; Fri, 14 Oct 2022 02:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665740899; cv=none; d=google.com; s=arc-20160816; b=YjCOOEz5HVePDyWXzFzUb7AsnyBVoGQpYxcKFPjqpbmnkftr6BwpFvyBf0Dk2QT43m NoLRjyq1U9TxDZBh6AWqSOLaiZiL7d8XP2IdEYfG+T2G+iJG7ZgGK+ZX5yvWtzHYNBC5 XHQ+4YHN3T+assacyIC4B5BkyAlPXV+epif4zFV0tsql7gX5ajmtTz2TZsJLhb+7ms7w sSIMTSKmWUkKJAyzLheyJ3IXTFtAz14vO3+NhH6S0eKD80ZJ5GyGh1mtDgBzFpTrmuPU +23K1AgRySqqw0efqUf2QEkkgxjxap/Bla1sjzjTpW93Hg/OAgz6gLLWgfsuoSNbmli1 OZMg== 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=IfDywsy4fZBasWQwWtRxW2pczZMSbYPHDD4StNsLvyo=; b=l3hCw5DDfL09T9NnXUDFpuDpBU3r0qEUVHpyk7e4L7nHwY5rPZlsW1yWgiqtocBIAw JFt3aNPNKM62fcTXTcB6lNm3uDm35kl9gJuBf1u/aZJXkCR5JUU4Fh5RLodPB4nalwL2 2CFg940jmwwaJYBIVhhXu01F2h0gHutYMAC/lcGlqD8G2Iqj4CEjyoBeecRBFDoAbiKg FBeDZU6GH7nzzeOvjKbJz9LBp9c9rWUSC2nTV3EG5STZl8HJNa61GCJUT2E/N7JnY+9c Of+1oYP50FSZxjnxavMbCPsHO9U0AbDFJaFuh0XrH+k6Jm4056Y2skZPiFHG037mVdW7 w+Kg== 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 t18-20020a170902b21200b00183243cd10esi2431170plr.134.2022.10.14.02.48.05; Fri, 14 Oct 2022 02:48:19 -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 S229732AbiJNJoB (ORCPT + 99 others); Fri, 14 Oct 2022 05:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbiJNJnv (ORCPT ); Fri, 14 Oct 2022 05:43:51 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DA1C14DF05; Fri, 14 Oct 2022 02:43:50 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MphDH5zTbz1P7CB; Fri, 14 Oct 2022 17:39:11 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 17:43:48 +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; Fri, 14 Oct 2022 17:43:48 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH 3/3] crypto: hisilicon/qm - delete redundancy check Date: Fri, 14 Oct 2022 09:38:07 +0000 Message-ID: <20221014093807.3101-4-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221014093807.3101-1-yekai13@huawei.com> References: <20221014093807.3101-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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?1746655929934642225?= X-GMAIL-MSGID: =?utf-8?q?1746655929934642225?= 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 661cc964e2eb..318896df1f89 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -4634,9 +4634,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;