From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Shunsuke Mie <mie@igel.co.jp>
Cc: "Kishon Vijay Abraham I" <kishon@ti.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Dan Carpenter" <dan.carpenter@oracle.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 1/2] misc: pci_endpoint_test: Aggregate params checking for xfer
Date: Tue, 6 Sep 2022 12:58:13 +0200 [thread overview]
Message-ID: <YxcnxSPEVeCcMHmZ@kroah.com> (raw)
In-Reply-To: <20220906101555.106033-1-mie@igel.co.jp>
On Tue, Sep 06, 2022 at 07:15:54PM +0900, Shunsuke Mie wrote:
> Each transfer test functions have same parameter checking code. This patch
> unites those to an introduced function.
>
> Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
> ---
> Changes in v2:
> * New patch
> ---
> ---
> drivers/misc/pci_endpoint_test.c | 35 ++++++++++++++++++++++++++------
> 1 file changed, 29 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index 8f786a225dcf..3bd9f135cdac 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -332,6 +332,17 @@ static bool pci_endpoint_test_msi_irq(struct pci_endpoint_test *test,
> return false;
> }
>
> +static int pci_endpoint_test_validate_xfer_params(struct device *dev,
> + struct pci_endpoint_test_xfer_param *param, size_t alignment)
> +{
> + if (param->size > SIZE_MAX - alignment) {
> + dev_err(dev, "Maximum transfer data size exceeded\n");
Do not allow userspace to spam the kernel log.
This should be dev_dbg() at most.
thanks,
greg k-h
next prev parent reply other threads:[~2022-09-06 10:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 10:15 [RFC PATCH v2 1/2] misc: pci_endpoint_test: Aggregate params checking for xfer Shunsuke Mie
2022-09-06 10:15 ` [RFC PATCH v2 2/2] misc: pci_endpoint_test: Fix pci_endpoint_test_{copy,write,read}() panic Shunsuke Mie
2022-09-06 10:59 ` Greg Kroah-Hartman
2022-09-06 10:58 ` Greg Kroah-Hartman [this message]
2022-09-06 10:58 ` [RFC PATCH v2 1/2] misc: pci_endpoint_test: Aggregate params checking for xfer Greg Kroah-Hartman
2022-09-07 1:59 ` Shunsuke Mie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YxcnxSPEVeCcMHmZ@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@oracle.com \
--cc=kishon@ti.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mie@igel.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).