On Fri, Oct 16, 2015 at 08:50:42AM -0700, Kees Cook wrote: > On Fri, Oct 16, 2015 at 8:25 AM, Geliang Tang <geliangt...@163.com> wrote: > > +static struct dentry *dir; > > Since this is no longer a local, it should probably be renamed > something more descriptive. >
I renamed it pstore_ftrace_dir. > > +static void free_buf_for_compression(void) > > +{ > > + kfree(stream.workspace); > > + kfree(big_oops_buf); > > I think both of these should be set to NULL after their kfrees. > I did it as you suggested. > > static void pstore_register_console(void) > > { > > + pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME; > > Why do these flags need to move here? > No need to deal these console flags here specifically. I drop it. > > - if (owner && !try_module_get(owner)) { > > - psinfo = NULL; > > - return -EINVAL; > > - } > > Don't we still need to hold a module reference? > Yes. I simply add module_put in pstore_register() to deal with it. Maybe it's not good enough. Please give me some advices. Thanks. Geliang Tang (3): pstore: add vmalloc error check pstore: add a helper function pstore_register_kmsg pstore: add pstore unregister fs/pstore/Kconfig | 2 +- fs/pstore/Makefile | 6 +++--- fs/pstore/ftrace.c | 23 ++++++++++++++++++----- fs/pstore/inode.c | 7 +++++++ fs/pstore/internal.h | 4 ++++ fs/pstore/platform.c | 42 +++++++++++++++++++++++++++++++++++++++++- fs/pstore/pmsg.c | 9 +++++++++ fs/pstore/ram.c | 17 +++++++---------- include/linux/pstore.h | 14 +------------- kernel/printk/printk.c | 1 + 10 files changed, 92 insertions(+), 33 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/