From patchwork Wed Apr 5 09:23:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 96795 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp173374qgd; Wed, 5 Apr 2017 02:23:46 -0700 (PDT) X-Received: by 10.84.222.4 with SMTP id w4mr13937181pls.184.1491384225952; Wed, 05 Apr 2017 02:23:45 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y73si20044853pgd.394.2017.04.05.02.23.45; Wed, 05 Apr 2017 02:23:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933094AbdDEJXe (ORCPT + 2 others); Wed, 5 Apr 2017 05:23:34 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36910 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932632AbdDEJXd (ORCPT ); Wed, 5 Apr 2017 05:23:33 -0400 Received: by mail-wm0-f49.google.com with SMTP id x124so8373181wmf.0 for ; Wed, 05 Apr 2017 02:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NblNsCCdKsolqY0/mEOG3SpUSa3gIKzcKf00koxyk0Q=; b=TbjojhFj9WL9llJHaS/HwbTX15FvlVUe7yaVZYM8PgnmVEqk+UF4fZNpvrdzx5Dy6Z CODWipjcEruis0gNa5HIcHeAIWL509r2MvVQzTwco7cH15ylZSh2Ay0pDtXeBsCDciOA eDEEFnasw9n4gUBjwq2EuzZhuWFTfQ9LSOcM8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NblNsCCdKsolqY0/mEOG3SpUSa3gIKzcKf00koxyk0Q=; b=J5iu/OXKHHB9fynK5uoyg+EwtEE+CvjWxr4EsIkJAnJOIni1ThSHsrkAl23Q5HIc8m DeVrGfQSKWaKlOv7D1Q9CbCXV4XqmsXbGviQ3vm9y38ZPAvyOgV+ObbhoO5h5VtWvG7o 07YLwTZfdrTHeZRZr7qkpOqZsXrl/yNpYj5QGgcfgMik0qne9CFjGnQddaBCJoDn/d+K BM2jOHc09cRhRux0Mm6Mig6mbG2NhfIwJcvtBPD0B8Xn4+bYMpHLUATPl7qoRNcEdKKg CVDcKgKcaCpmKqhHh07P1GEoB/EaMD0cMVNDLwVVboUfiLKtSbUSTbFp8Xol25r/APZh 66Jw== X-Gm-Message-State: AFeK/H3Rpj7QjuY7kKMBo3MLmNHe0eog5KyvKO3t59UtBV8ERb9PLVVS /Oepd6Q0pQOrtaa2 X-Received: by 10.28.23.194 with SMTP id 185mr18042505wmx.52.1491384211744; Wed, 05 Apr 2017 02:23:31 -0700 (PDT) Received: from localhost.localdomain ([160.163.145.113]) by smtp.gmail.com with ESMTPSA id b66sm23935271wrd.29.2017.04.05.02.23.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 02:23:31 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk, andy.shevchenko@gmail.com, pure.logic@nexus-software.ie, hock.leong.kweh@intel.com, bp@alien8.de, sascha.weisenberger@siemens.com, jan.kiszka@siemens.com, Ard Biesheuvel Subject: [PATCH 2/8] efi/capsule: Remove pr_debug on ENOMEM or EFAULT Date: Wed, 5 Apr 2017 10:23:11 +0100 Message-Id: <20170405092317.27921-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170405092317.27921-1-ard.biesheuvel@linaro.org> References: <20170405092317.27921-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Jan Kiszka Both cases are not worth a debug log message - the error code is telling enough. Signed-off-by: Jan Kiszka Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Matt Fleming diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c index 91e91f7a8807..7b57dda2417d 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; }