lkml.org 
[lkml]   [2021]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5] printk: Userspace format enumeration support
Greg Kroah-Hartman writes:
>On Wed, Mar 10, 2021 at 02:30:31AM +0000, Chris Down wrote:
>> + ps->file = debugfs_create_file(pi_get_module_name(mod), 0444, dfs_index,
>> + ps, &dfs_index_fops);
>> +
>> + if (IS_ERR(ps->file)) {
>> + pi_sec_remove(mod);
>> + return;
>> + }
>
>No need to check this and try to clean up if there is a problem, just
>save the pointer off and call debugfs_remove() when you want to clean
>up.

Petr, what are your thoughts on this, since you requested the cleanup on
debugfs failure? :-)

>Or better yet, no need to save anything, you can always look it up when
>you want to remove it, that will save you one pointer per module.

That's a good point, and with that maybe we can even do away with the pi_sec
entirely then since that only leaves start/end pointers which we can calculate
on demand from existing data.

\
 
 \ /
  Last update: 2021-03-10 13:14    [W:0.134 / U:1.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site