<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><span style="color: rgb(17, 17, 17); font-family: Helvetica,
Arial, sans-serif; font-size: 14px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;"></span>Thank
you for your prompt reply, we should not add extra checked. <span
class="moz-smiley-s1"><span></span></span><br>
</p>
I will fix it in the next v2.<br>
Thanks.<br>
<div class="moz-cite-prefix">On 2020/7/21 14:57, Zhangfei Gao wrote:<br>
</div>
<blockquote
cite="mid:0775c541-5802-cdf3-e2aa-c62c027ab8a7@linaro.org"
type="cite">
<br>
<br>
On 2020/7/20 下午3:18, Kai Ye wrote:
<br>
<blockquote type="cite">1. add some parameter check.
<br>
2. delete some redundant code.
<br>
3. modify the module author information.
<br>
<br>
Signed-off-by: Kai Ye <a class="moz-txt-link-rfc2396E" href="mailto:yekai13@huawei.com"><yekai13@huawei.com></a>
<br>
Reviewed-by: Zhou Wang <a class="moz-txt-link-rfc2396E" href="mailto:wangzhou1@hisilicon.com"><wangzhou1@hisilicon.com></a>
<br>
</blockquote>
Thanks Kai.
<br>
<blockquote type="cite">---
<br>
drivers/misc/uacce/uacce.c | 28 +++++++++++++---------------
<br>
1 file changed, 13 insertions(+), 15 deletions(-)
<br>
<br>
diff --git a/drivers/misc/uacce/uacce.c
b/drivers/misc/uacce/uacce.c
<br>
index 107028e..2e1af58 100644
<br>
--- a/drivers/misc/uacce/uacce.c
<br>
+++ b/drivers/misc/uacce/uacce.c
<br>
@@ -63,8 +63,12 @@ static long uacce_fops_unl_ioctl(struct file
*filep,
<br>
unsigned int cmd, unsigned long arg)
<br>
{
<br>
struct uacce_queue *q = filep->private_data;
<br>
- struct uacce_device *uacce = q->uacce;
<br>
+ struct uacce_device *uacce;
<br>
+
<br>
+ if (WARN_ON(!q))
<br>
+ return -EINVAL;
<br>
</blockquote>
WARN_ON should not be used in uacce, instead error can be printed
in user space driver.
<br>
Error should not be printed in kernel log as pasid can be used by
unpriv user.
<br>
<br>
And I think we do not need check filep->private_data.
<br>
The fd is double checked in __fget_files.
<br>
<br>
Thanks
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>