Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp22668pxb; Wed, 30 Mar 2022 21:47:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/OpGQf4XR04P69kD8/9uSug/E6I+UY9FmaZZ1SMG0WZMBhuf51Dzk1VGgYA/P4Zcm2mnX X-Received: by 2002:a17:90b:4a0b:b0:1c7:221a:a600 with SMTP id kk11-20020a17090b4a0b00b001c7221aa600mr4045472pjb.112.1648702046901; Wed, 30 Mar 2022 21:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648702046; cv=none; d=google.com; s=arc-20160816; b=R6pmohrTjhNto8Iv9V6l5d1G2Au9M8NRoGi4oADJonas2NrMqjF5B5ZcceeHbuML+m DZEFY93rRqnvSMUBlQS4s/ASCH7uaJkBUkmsrVbYmRey1TqngIhV9nfyf89bpTnKj6Qc 1/Swm49zN55cgAcok8Zo6Y0T3m4yse6TGdhxrVqJ5b1901tF7c6aWoQ1j3nCBx//6DJN pWB7bQQpgG8r7Pa4uybe1GmbFQ6n2TTiFpIlvi+9CexV4D5IEzUZybGyx3RyEGh/+xQY Ax/2buQcknX0fyL8J+ryRFk2qS8lzUXJ5JQ0dLZYWVGtwwPUVHJfCwm4FYfYJeF4yBNE JFsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=//DH3n73D9pqUweigYjwzCZ2kMfnfzhZb5bBwkKd3AQ=; b=y76eScsh0kBWzkUPnGh3nQaReb79pTXlnkzH5cB09ZxKt8v9ytPByEayqk6SErO0Pn WxmCP3+15x7FC1QV/KL11e7BZtZZEQyN3CPQ0pbwi4J2o6k7FBOQ36kM8ZHOFwVhNBGt g2Qm+0RN7AJcSr0VFynS2EwV4c/5VgeA8+S3w8IGDMqOdob74jlGwP6zsPkENSTarJ/J 5U7r7UjxHGjMLzJYRhu+do5AnBCXsxjWm8jxOTyg6Lhlj5NmHMaDHcqtfuCp4C41+fnB Oz/6DPbJ6RgAmvEpps8hTO5e5pEL8uMtLIo9ET85j/WJc9D8So3RvU3SfL+259BnROaU w3NQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pg1-20020a17090b1e0100b001c6add0d56csi2334052pjb.54.2022.03.30.21.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:47:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 30D0A1EC62D; Wed, 30 Mar 2022 20:27:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350373AbiC3TCS (ORCPT + 99 others); Wed, 30 Mar 2022 15:02:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350306AbiC3TCM (ORCPT ); Wed, 30 Mar 2022 15:02:12 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CCE5265D3B; Wed, 30 Mar 2022 12:00:26 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1nZdYO-0003Qd-01; Wed, 30 Mar 2022 21:00:24 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 63D91C4DEF; Wed, 30 Mar 2022 20:34:48 +0200 (CEST) Date: Wed, 30 Mar 2022 20:34:48 +0200 From: Thomas Bogendoerfer To: xkernel.wang@foxmail.com Cc: john@phrozen.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: lantiq: check the return value of kzalloc() Message-ID: <20220330183448.GB18042@alpha.franken.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 07:49:41PM +0800, xkernel.wang@foxmail.com wrote: > From: Xiaoke Wang > > kzalloc() is a memory allocation function which can return NULL when > some internal memory errors happen. So it is better to check the > return value of it to prevent potential wrong memory access or > memory leak. > > Signed-off-by: Xiaoke Wang > --- > arch/mips/lantiq/falcon/sysctrl.c | 2 ++ > arch/mips/lantiq/xway/gptu.c | 2 ++ > arch/mips/lantiq/xway/sysctrl.c | 46 ++++++++++++++++++++----------- > 3 files changed, 34 insertions(+), 16 deletions(-) applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]