From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 039F4C433F5 for ; Thu, 28 Apr 2022 10:25:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234840AbiD1K2b (ORCPT ); Thu, 28 Apr 2022 06:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiD1K22 (ORCPT ); Thu, 28 Apr 2022 06:28:28 -0400 X-Greylist: delayed 8042 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 28 Apr 2022 03:25:12 PDT Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C152E1837A; Thu, 28 Apr 2022 03:25:10 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 87B01374; Thu, 28 Apr 2022 12:25:08 +0200 (CEST) Date: Thu, 28 Apr 2022 12:25:07 +0200 From: Joerg Roedel To: xkernel.wang@foxmail.com Cc: agross@kernel.org, bjorn.andersson@linaro.org, will@kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iommu/msm: add a check for the return of kzalloc() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 28, 2022 at 04:52:39PM +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 it to > prevent potential wrong memory access. > > Besides, to propagate the error to the caller, the type of > insert_iommu_master() is changed to `int`. Several instructions related > to it are also updated. > > Signed-off-by: Xiaoke Wang > --- > ChangeLog: > v1->v2 propagate the error to the caller. > drivers/iommu/msm_iommu.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) Applied, thanks.