[<prev] [next>] [day] [month] [year] [list]
Message-ID: <SL2PR06MB3082C7F7EC6998AE99A66244BDBF9@SL2PR06MB3082.apcprd06.prod.outlook.com>
Date: Thu, 21 Oct 2021 01:27:33 +0000
From: 王擎 <wangqing@...o.com>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
CC: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 回复: [PATCH] firmware: tegra: switch over to memdup_user()
>> --- 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
Powered by blists - more mailing lists