From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753077AbbJRKxJ (ORCPT ); Sun, 18 Oct 2015 06:53:09 -0400 Received: from m50-135.163.com ([123.125.50.135]:56331 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466AbbJRKwU (ORCPT ); Sun, 18 Oct 2015 06:52:20 -0400 From: Geliang Tang To: Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Cc: Geliang Tang , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] pstore: add pstore unregister Date: Sun, 18 Oct 2015 18:49:22 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: X-CM-TRANSID: D9GowAC3ewg5eSNW4K79Dg--.8858S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7uw15JF17Ww1ktFWrJFWfuFg_yoW8WrWfpF Z3G343tr95JF9xX3yfX3WUZF45Gr4kJFsagrnxtw1rtw1Uur1kZr4vy3WfKa45Cry8CrWx JFs8Aw15WFWDArJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UIdgAUUUUU= X-Originating-IP: [116.77.146.166] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiGRuXmVXlOr96KQAAsq Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 16, 2015 at 08:50:42AM -0700, Kees Cook wrote: > On Fri, Oct 16, 2015 at 8:25 AM, Geliang Tang 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