[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210622151608.23741-1-colin.king@canonical.com>
Date: Tue, 22 Jun 2021 16:16:08 +0100
From: Colin King <colin.king@...onical.com>
To: Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>,
Qinglang Miao <miaoqinglang@...wei.com>, qat-linux@...el.com,
linux-crypto@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] crypto: qat: ratelimit invalid ioctl message and print the invalid cmd
From: Colin Ian King <colin.king@...onical.com>
Currently incorrect QAT ioctls can spam the kernel log with error messages
of the form "QAT: Invalid ioctl" if a userspace program uses the wrong
ioctl command. Quench the messages by ratelimiting them and also print
the invalid command being used as that is useful to know.
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
index 96b437bfe3de..6f64aa693146 100644
--- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c
+++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
@@ -406,7 +406,7 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
ret = adf_ctl_ioctl_get_status(fp, cmd, arg);
break;
default:
- pr_err("QAT: Invalid ioctl\n");
+ pr_err_ratelimited("QAT: Invalid ioctl %d\n", cmd);
ret = -EFAULT;
break;
}
--
2.31.1
Powered by blists - more mailing lists