Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2437533iob; Sat, 30 Apr 2022 08:32:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmUOXU89nk+nhZ9I9u4aX/k3Ne5dj+xN4aL4zkCuoxZ+7mXskAJfRSBJwv4AB9hMQHyXpI X-Received: by 2002:a2e:81c1:0:b0:24b:f44:3970 with SMTP id s1-20020a2e81c1000000b0024b0f443970mr2941603ljg.97.1651332750610; Sat, 30 Apr 2022 08:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651332750; cv=none; d=google.com; s=arc-20160816; b=aKYOH7psc2pvEnA/KbVvxrY6ZB6vDYA5dJOErMe4qM9AEYkAsy4mAkknyjVZnEQJfB jZRXUnuYLc1mtU3sjSKU7jXWC9/1OGJPyFM0C63lgaQ8HV5MpCh2iByxoWAsvh5VNUQt EE1nNGeSbsPK4lVMBN1q5gy76UyuuN5OikdIebRn6yUwrcASuHpVoAdmRe2N5FtMu2ga OQRl+9yQJOtCo7EEu7PAvJJuVzgRcWAKM/LVTiyydWh9T+qxWxFyXRY/pROUWoaIV5Fo 3UVMEEzUs2vgaQgBJWeRZytbpcWDPHcp1uliq+jXXM5WVJLx43aqrS9tjdhWFTE0Wb3r 9Y4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PPEhKtF0sbeyujzm9thZEDJXkLxwy3zvWFKn/rMauzg=; b=UfY1ZVDFyjuTnQscO/GjX2UqIFk9KU9g506XJWkSqkjrOSOq8IGHs4JFBZ6IR6LE5+ xpxkv6xBSzNmbyqGVfOwUABhLFcfS55SFFYhEE0HUzWI8dTMutk7SImdSuefXERKi12W gfcyr9HPLFVJMpNxHKeMKXX+u1NIJ4bpp/elybSvZbNCtc26cTjmfTgCfRcvsQCxr22W uO7opz8JugTgiAlzeQTzIZMHSJLIFIGRINJHW7b8inB/bZ8dNrKMj51suVKHklhjtnz7 Oni6Cp0pEO2zd8ifhKkLT0Akto62F/ofUMfpIj1edGgELKZII6xQ6VfxU62lkuLyREr9 4xyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=pyJ3fGMr; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cf27-20020a056512281b00b00471fe39c4d6si11945948lfb.272.2022.04.30.08.32.02; Sat, 30 Apr 2022 08:32:30 -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 (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=pyJ3fGMr; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378292AbiD2PWt (ORCPT + 99 others); Fri, 29 Apr 2022 11:22:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352753AbiD2PWs (ORCPT ); Fri, 29 Apr 2022 11:22:48 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52277D4C97 for ; Fri, 29 Apr 2022 08:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=PPEhKtF0sbeyujzm9thZEDJXkLxwy3zvWFKn/rMauzg=; b=pyJ3fGMrzIjrPqmogJnmqGVwL9 wgbSjJSFApC9+hZGKIuVIsHA2YByvO1vYQpx2Ik7LXVsoALcsE9G0Gmigyk3Ez1pyfd8g4CLXZqpj 9h9MPMuHoN4KykqBBkfjbG7SnzXneSRJsGcHLy+hXv70MAxhQRLG4vwGFbXyi93vmfNuBNnRLVXSN nMz4lQpp4850iFRYrVsrVz2piZbGEnCddja+jgw8qpioI8TmHTkKdQWeLcm8Bs6BMwfn4pMS60Fh/ FP6Vz7RvJkAKAVue13EySfL1anrmNqOOrEutnjpIwqWxFe6185QcTGoP8FduHitU3WRRO7Wg4Noi+ 8kBlSgxA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58442) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nkSOv-0004BC-Q4; Fri, 29 Apr 2022 16:19:21 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nkSOp-00022l-UK; Fri, 29 Apr 2022 16:19:15 +0100 Date: Fri, 29 Apr 2022 16:19:15 +0100 From: "Russell King (Oracle)" To: xkernel.wang@foxmail.com Cc: andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: mvebu: check the validation of memory allocation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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 Fri, Mar 25, 2022 at 04:55:18PM +0800, xkernel.wang@foxmail.com wrote: > From: Xiaoke Wang > > kzalloc() and kstrdup() are memory allocation functions which can return > NULL when some internal memory errors happen. So it is better to check > the return value of them to prevent potential wrong memory access or > memory leak. Are these failures silent, or will they be reported in the kernel log to make their failure obvious to those who debug the kernel? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!