Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964966AbdCXSQH (ORCPT ); Fri, 24 Mar 2017 14:16:07 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:35025 "EHLO mail-it0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935497AbdCXSPZ (ORCPT ); Fri, 24 Mar 2017 14:15:25 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Ard Biesheuvel Date: Fri, 24 Mar 2017 18:15:12 +0000 Message-ID: Subject: Re: [PATCH v2 2/7] efi/capsule: Remove pr_debug on ENOMEM or EFAULT To: Jan Kiszka Cc: Matt Fleming , "linux-efi@vger.kernel.org" , Linux Kernel Mailing List , Andy Shevchenko , "Bryan O'Donoghue" , Hock Leong Kweh , Borislav Petkov , Sascha Weisenberger Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2755 Lines: 67 On 24 March 2017 at 17:34, Jan Kiszka wrote: > Both cases are not worth a debug log message - the error code is telling > enough. > > Signed-off-by: Jan Kiszka Reviewed-by: Ard Biesheuvel > --- > drivers/firmware/efi/capsule-loader.c | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c > index 91e91f7..7b57dda 100644 > --- a/drivers/firmware/efi/capsule-loader.c > +++ b/drivers/firmware/efi/capsule-loader.c > @@ -88,10 +88,8 @@ static ssize_t efi_capsule_setup_info(struct capsule_info *cap_info, > temp_page = krealloc(cap_info->pages, > pages_needed * sizeof(void *), > GFP_KERNEL | __GFP_ZERO); > - if (!temp_page) { > - pr_debug("%s: krealloc() failed\n", __func__); > + if (!temp_page) > return -ENOMEM; > - } > > cap_info->pages = temp_page; > cap_info->header_obtained = true; > @@ -111,10 +109,8 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info) > > cap_hdr_temp = vmap(cap_info->pages, cap_info->index, > VM_MAP, PAGE_KERNEL); > - if (!cap_hdr_temp) { > - pr_debug("%s: vmap() failed\n", __func__); > + if (!cap_hdr_temp) > return -ENOMEM; > - } > > ret = efi_capsule_update(cap_hdr_temp, cap_info->pages); > vunmap(cap_hdr_temp); > @@ -171,7 +167,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff, > if (!cap_info->page_bytes_remain) { > page = alloc_page(GFP_KERNEL); > if (!page) { > - pr_debug("%s: alloc_page() failed\n", __func__); > ret = -ENOMEM; > goto failed; > } > @@ -184,7 +179,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff, > > kbuff = kmap(page); > if (!kbuff) { > - pr_debug("%s: kmap() failed\n", __func__); > ret = -ENOMEM; > goto failed; > } > @@ -193,7 +187,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff, > /* Copy capsule binary data from user space to kernel space buffer */ > write_byte = min_t(size_t, count, cap_info->page_bytes_remain); > if (copy_from_user(kbuff, buff, write_byte)) { > - pr_debug("%s: copy_from_user() failed\n", __func__); > ret = -EFAULT; > goto fail_unmap; > } > -- > 2.10.2 >