From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752699AbcJJXwr (ORCPT ); Mon, 10 Oct 2016 19:52:47 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:33271 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752419AbcJJXwp (ORCPT ); Mon, 10 Oct 2016 19:52:45 -0400 MIME-Version: 1.0 In-Reply-To: <1475904515-24970-4-git-send-email-joelaf@google.com> References: <1475904515-24970-1-git-send-email-joelaf@google.com> <1475904515-24970-4-git-send-email-joelaf@google.com> From: Kees Cook Date: Mon, 10 Oct 2016 16:52:43 -0700 X-Google-Sender-Auth: edBrn933-LCNDQjOkrMad33qFtw Message-ID: Subject: Re: [PATCH 3/7] pstore: Remove case of PSTORE_TYPE_PMSG write using deprecated function To: Joel Fernandes Cc: LKML , Steven Rostedt , Anton Vorontsov , Colin Cross , Tony Luck Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 7, 2016 at 10:28 PM, Joel Fernandes wrote: > PMSG now uses ramoops_pstore_write_buf_user instead of ramoops_pstore_write_buf > Remove the case where we check PSTORE_TYPE_PMSG case. Ah yeah, good point. Can you actually improve this to add a ratelimited WARN() to both _write_buf and write_buf_user when an unhandled type is encountered? -Kees > > Signed-off-by: Joel Fernandes > --- > fs/pstore/ram.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c > index 751197d..519404c 100644 > --- a/fs/pstore/ram.c > +++ b/fs/pstore/ram.c > @@ -287,11 +287,6 @@ static int notrace ramoops_pstore_write_buf(enum pstore_type_id type, > return -ENOMEM; > persistent_ram_write(cxt->fprz, buf, size, 1); > return 0; > - } else if (type == PSTORE_TYPE_PMSG) { > - if (!cxt->mprz) > - return -ENOMEM; > - persistent_ram_write(cxt->mprz, buf, size, 1); > - return 0; > } > > if (type != PSTORE_TYPE_DMESG) > -- > 2.7.4 > -- Kees Cook Nexus Security