From: 王擎 <wangqing@vivo.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 回复: [PATCH] firmware: tegra: switch over to memdup_user()
Date: Thu, 21 Oct 2021 01:27:33 +0000 [thread overview]
Message-ID: <SL2PR06MB3082C7F7EC6998AE99A66244BDBF9@SL2PR06MB3082.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <AJsAPABcEiDeZ4ZDMvu*CapV.9.1634778945247.Hmail.wangqing@vivo.com>
>> --- a/drivers/firmware/tegra/bpmp-debugfs.c
>> +++ b/drivers/firmware/tegra/bpmp-debugfs.c
>> @@ -376,18 +376,11 @@ static ssize_t bpmp_debug_store(struct file *file, const char __user *buf,
>> if (!filename)
>> return -ENOENT;
>>
>> - databuf = kmalloc(count, GFP_KERNEL);
>> - if (!databuf)
>> - return -ENOMEM;
>> -
>> - if (copy_from_user(databuf, buf, count)) {
>> - err = -EFAULT;
>> - goto free_ret;
>> - }
>> + databuf = memdup_user(buf, count);
>> + if (IS_ERR(databuf))
>> + return ERR_PTR(PTR_ERR(databuf));
>
>ERR_PTR() is too much here.
>
>Best Regards
>Michał Mirosław
Sorry about that, I have resent the patch, Please ignore this version.
Thanks,
Qing
prev parent reply other threads:[~2021-10-21 1:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 7:59 [PATCH] firmware: tegra: switch over to memdup_user() Qing Wang
2021-10-21 1:15 ` Michał Mirosław
[not found] ` <AJsAPABcEiDeZ4ZDMvu*CapV.9.1634778945247.Hmail.wangqing@vivo.com>
2021-10-21 1:27 ` 王擎 [this message]
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=SL2PR06MB3082C7F7EC6998AE99A66244BDBF9@SL2PR06MB3082.apcprd06.prod.outlook.com \
--to=wangqing@vivo.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=thierry.reding@gmail.com \
/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).