Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4231951rwn; Sun, 11 Sep 2022 07:43:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR5z9CkD7TmX+Mb92dLz8g2eXU45AVVk/SrDNpXukJ1wi6WD4XkGb/wHUmU5bg3anXVFVj9h X-Received: by 2002:a17:90a:b781:b0:1fb:2f6b:12ed with SMTP id m1-20020a17090ab78100b001fb2f6b12edmr18980634pjr.204.1662907434479; Sun, 11 Sep 2022 07:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662907434; cv=none; d=google.com; s=arc-20160816; b=TSyEzpuwuNoeIRXN51j+MhhNH4Ydo0m6+Rv+wI6HIfiqE+tpt1JBl1ykV3uwz9cGnk 7AK4A9gxvKzRqHN73v0z+dq6jhSIGy6IHiBdG+r9Wy8KMzdy+Y8hzFpBL/q0hZhRrmVR xSwmqu+FarqOeZvD9migsZv3s+PmsNDqNmlcPEUivZ91w1gro3vzHxV6ZKJNJNj0pBYP QWD9L03Fm0fC1R2lAcD8XumF1JcfnGx01twl8BC2pEbfeLYRDoKxQ2tzZlYbdJcBhy3V 1kHVkh9PgaTz9ALPU6AyRtwg4IK7Z58qj1A+blAraeJB/ZODGsPzHsWYKdaO+qPi8eWH GLxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kpsNGXGOItgP3sw4KOrd3S9yFWs1L7+N0vhR0sDgBaY=; b=Mgx5Kmbd/4+pGzMGfiNgdqTVN0s+gDgw0FgmsqSydFwhKq1bCSZ/mxRZw7IQd8RaOn Kr5kx55iCFsIS+/AhAR4pJ9NIG174ZCocCrEA1eoAZ/1AOrdfA55nOHzk8DC6s9QFHwp 8WOo7cgRgipGLaryoiFBC5CGAsQsoH+7x4F6c2/pCxHnuoMHZWqP64UQUf8o75rQNvN8 ONoOzWnsPbnjrnhwKxsIquj+4w++/6eSsMhHILx171/c7DG+fx7y2FUYf7iHI2ZbEl4J POg9wgt52EBrgkJdUiiZJ8HhVj2zySrNs4gcyScsBEUsNFf5PrRhztg6hXh650PzTglC sbnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=jOSVKasy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t70-20020a638149000000b0042b57ff2893si4232302pgd.195.2022.09.11.07.43.38; Sun, 11 Sep 2022 07:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=jOSVKasy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229516AbiIKOg2 (ORCPT + 99 others); Sun, 11 Sep 2022 10:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbiIKOgZ (ORCPT ); Sun, 11 Sep 2022 10:36:25 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D42A26AE1; Sun, 11 Sep 2022 07:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kpsNGXGOItgP3sw4KOrd3S9yFWs1L7+N0vhR0sDgBaY=; b=jOSVKasy912ZupPC6tF4+4gA4E aq/7HZeJs78AhM0F8XVNCL1U8z3elkPNGUXZGTsUcxtQkh7zzgz5hGAvQ1wOzRZcURsJfniKKd223 7AlEeEcOdrK6OgysxCzoHOTePSWlzgDwjOFaSgkEaOaBoJhwKH/j9ll0Qjc0jhsZajGqgcl7mwo9s ggoU5EFBIA5MYAfujMOiXPRupEN0KkUx6LYbkUYO7yG+t2NGzGieOyeXHoyfdTnbQYMijkg+8ixy+ L3R/8M8AambOj55ErYdhSOi/ujlatQB3b96K32Jid4J61ZMfSKvi3nZ6udL1hWpsQ7+mcxYzghkz1 KVv8HkuQ==; Received: from [177.215.76.177] (helo=[192.168.1.60]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1oXO4H-00FOtz-Ut; Sun, 11 Sep 2022 16:36:18 +0200 Message-ID: Date: Sun, 11 Sep 2022 11:36:00 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH V2] efi: efibc: Guard against allocation failure Content-Language: en-US To: ardb@kernel.org, Christophe JAILLET , linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, matt@codeblueprint.co.uk, mjg59@srcf.ucam.org References: <20220909194214.186731-1-gpiccoli@igalia.com> <04d65bd7-a6b2-bb14-fd69-632542ae9e86@wanadoo.fr> From: "Guilherme G. Piccoli" In-Reply-To: <04d65bd7-a6b2-bb14-fd69-632542ae9e86@wanadoo.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/09/2022 01:56, Christophe JAILLET wrote: > [...] >> wdata = kmalloc(MAX_DATA_LEN * sizeof(efi_char16_t), GFP_KERNEL); > Hi, > > even if mostly useless in this case, kmalloc_array()? > > Or certainly maybe even better, kstrndup()? > > CJ > Thanks! It's up to Ard, I could rework with this change if makes sense. Cheers, Guilherme