lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] binder: fix redefinition of seq_file attributes
On Fri, Jul 01, 2022 at 06:20:41PM +0000, Carlos Llamas wrote:
> + binder_for_each_debugfs_entry(db_entry) {
> + dentry = binderfs_create_file(binder_logs_root_dir,
> + db_entry->name,
> + db_entry->fops,
> + db_entry->data);
> + if (IS_ERR(dentry)) {
> + ret = PTR_ERR(dentry);
> + goto out;
> + }

I know this is a copy of what is there already, but there is never a
need to check the result of a debugfs_create_* call. Just call it and
move on, never "abort" based on the result of a debugfs call, that's not
a good idea.

So can you change this here, or want to send a follow-on patch that
removes these checks?

> }
>
> proc_log_dir = binderfs_create_dir(binder_logs_root_dir, "proc");

Also there's never a need to save a directory, you can always look it up
when you want to remove it.

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-07-04 18:14    [W:0.059 / U:1.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site