lkml.org 
[lkml]   [2022]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/4] cachestat: implement cachestat syscall
On Mon, Dec 05, 2022 at 09:51:39AM -0800, Nhat Pham wrote:

> + if (!access_ok(cstat, sizeof(struct cachestat)))
> + return -EFAULT;

What for? You are using copy_to_user() later, right?

> + f = fdget(fd);
> + if (f.file) {

It would be easier to read if you inverted the condition here.

\
 
 \ /
  Last update: 2022-12-11 00:54    [W:0.117 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site