Received: by 10.223.185.116 with SMTP id b49csp3978824wrg; Tue, 13 Feb 2018 10:41:51 -0800 (PST) X-Google-Smtp-Source: AH8x226XVS2Piz9bztzSEll9xc3pBcE16PHDBBBNE48R69vVG8a7lpK8OeWPCGUsKRk9e1n0BCTH X-Received: by 2002:a17:902:6b88:: with SMTP id p8-v6mr1267294plk.261.1518547311041; Tue, 13 Feb 2018 10:41:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518547311; cv=none; d=google.com; s=arc-20160816; b=E9F9YYMDWkHUlsz58OVc5vNAFP7m34YLY0i7fc+d6owBxhEJeQZObiaxSc0NQ0dqIY Plam91byepSqCABfmCQuPUFX6lquukD4lQOoQZfIQiJ1Tz9JqJqpG4fo/28/nMv6qn5f 8nlwKRwuo8jxI/cGHbjQLZmJsP0fBWEt9mEZOjT+BlPRB0pzJnjoKpkLlD6waBsbvPhi FPhfHZEAZ3B4XWUTCRFsDsmQERgxtBFJr6JZBGzh5pD1Wjay8E0bG5NKg3uKisY29yAh 2Gngm1lsp19UxUxxYAxjXeNO2Fs93+SOCU0RIJUg73I4zz/EVjnmQ23cSleWiv0BFj4m ZHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Gi6WOLF90AMNCompCzY6XL28fBIOI8an8x58gj+dJpE=; b=WrmP9UZYtn9D9jT55s3vHQI8f0KOsKWs4Dn7uYmAV1acBh4/c4CKt0dor2kJX52W8s FpmAlI6HoydHMoJWuRJ6QKjrqH+fdYxmNFe22jkvK79fiSWIyFNRCyzzObHRvtirr1K1 xPuM4O36nV0IH8ohvLa++nWYDMzV2PctYz75rLTLvjj+lu2RYGpctaJGBIk7MjmbwjqA H3d30sdEwvISFXlm9ilud8waa6YlwAWbFQ5zijxO2pKJJzTDZDykJxtc9ea95AsZ+qYz RwxN+AayO8cs7/18xB/ts23Z8V/YocHGh0Rhb66gLcNoWkXkYJ7pSu3/Lgkt7vel7mpg P4Ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v30si174639pgo.360.2018.02.13.10.41.36; Tue, 13 Feb 2018 10:41:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965523AbeBMSkh (ORCPT + 99 others); Tue, 13 Feb 2018 13:40:37 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:42851 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965390AbeBMSkg (ORCPT ); Tue, 13 Feb 2018 13:40:36 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id CB54B10195045; Tue, 13 Feb 2018 19:40:33 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 859D91E175; Tue, 13 Feb 2018 19:40:33 +0100 (CET) Date: Tue, 13 Feb 2018 19:40:33 +0100 From: Lukas Wunner To: SF Markus Elfring Cc: linux-efi@vger.kernel.org, Ard Biesheuvel , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] efi/apple-properties: Delete an error message for a failed memory allocation in unmarshal_devices() Message-ID: <20180213184033.GA24299@wunner.de> References: <145f8fac-9297-b362-d89f-886632e2507f@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <145f8fac-9297-b362-d89f-886632e2507f@users.sourceforge.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 13, 2018 at 06:00:26PM +0100, SF Markus Elfring wrote: > Omit an extra message for a memory allocation failure in this function. [snip] > --- a/drivers/firmware/efi/apple-properties.c > +++ b/drivers/firmware/efi/apple-properties.c > @@ -158,10 +158,8 @@ static int __init unmarshal_devices(struct properties_header *properties) > > entry = kcalloc(dev_header->prop_count + 1, sizeof(*entry), > GFP_KERNEL); > - if (!entry) { > - dev_err(dev, "cannot allocate properties\n"); > + if (!entry) > goto skip_device; > - } > > unmarshal_key_value_pairs(dev_header, dev, ptr, entry); > if (!entry[0].name) While the allocator does print an error when allocations fail, it may not be immediately apparent to the user what the *consequences* are. In this case, the consequence is that the device properties will not be available for consumption by drivers and they may fail to probe or behave in entirely unexpected ways. Hence I deliberately printed an error message here so that the user can make the connection between erratic behavior of drivers later on and the memory allocation error here. You didn't cc me on your submission even though I'm the author of 99% of this file. Please make an effort prior to submission to identify interested parties. Lukas