Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp873009iob; Thu, 28 Apr 2022 12:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk+EvzgR6I8zi4a/3Fw25W9tqTp3Zb6nn7Lgy1ahhSkhrrwWlyoavTZe7ayerbUCW1MhsL X-Received: by 2002:a19:505c:0:b0:472:6a4:12a1 with SMTP id z28-20020a19505c000000b0047206a412a1mr15514249lfj.522.1651174958572; Thu, 28 Apr 2022 12:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651174958; cv=none; d=google.com; s=arc-20160816; b=IsimARgMSuiVal58CpiQNJzQXNDaVxqmgeikDWFb8amqvQMFSNwUICOZsQGvSR5mMZ iCejwjnv4EvXUPCQDiD5gAbxrsmo3xLDYSujzkLuL+uTbRRetf/DJkWF1UdAP40V/MHt 518cRVqM0Wxn5QY1lhSvWUW60H0a346iiyqBy0XG57fm9ViSDL6xIBbH/pDD0kNHBdRP tEqnIcX65qMh/zBQ00C4HZKc7TAej5/TlK+8xNfEvbBAlnAs9igYxzuyQ+YalQH2kjY7 mUScy7HFonJl4bMBOEaFb7BpSVoWzpnGswQwfpa/ihVBhRIN4rUGf+Ma+gRQkOkSLGbp 59jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Z+88su3Nl0UezFonx4tyvVDJuZ2lHonpVQGkR3ESwTk=; b=Z0ysvzErXtIdLIbIj5TADpV/T4GZRQPZArC+YVGn7IT7FtvOMcP45DnFEZ4dLusRt5 NNg0IcgUIstLnUdS0tvV6wE8xDXBpUxgmQ7X5wFtsW5KaJTd4ch3AE01Z5TDuYHJ4NIf sDxQpJ8nukc5v0cFE1zgldECFzHukx85U6f+wRo7yxlISLqZVCF8pXyVKUlNrAcuB6ex PVMk1e0tZ4fwepfRcdjUen6NGXyccCLYohLACWGsmrSrPpgouDGu1xMQ1199Dl3XgtBE htQ8oeshYjJZAssYdkJHWOUphpy1F4Odc7yGNHfwJK9NpMYM9s8peGDPutJTmMXh/mB6 UdtA== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020ac24c55000000b004662a669ee6si5391979lfk.562.2022.04.28.12.42.10; Thu, 28 Apr 2022 12:42:38 -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; 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=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234776AbiD1K23 (ORCPT + 99 others); Thu, 28 Apr 2022 06:28:29 -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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS 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 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.