Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5571593pxb; Mon, 7 Feb 2022 05:11:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHbN9aSji3MLY+lWq65/DLG7QByX1G2OIPcTQp+icSdQzmrNxDSkhovpuuxvOvHGxe1Jow X-Received: by 2002:a63:6947:: with SMTP id e68mr9568457pgc.94.1644239463132; Mon, 07 Feb 2022 05:11:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644239463; cv=none; d=google.com; s=arc-20160816; b=tzkTQRHIndxr1ZClZrhBKWJojGkuemRClA81SFpxjXsFJt31Qqce9gqeGS1D6uPhYX /khhAr1Sq/pTKtOosXrYsH+v+hD9Sj/FuGYF4SuI+N4vx8W/IR1+yDg6d0t8xFswFcER cCuHtpPx7FjsaNaWFqLC8WAu9Bq5mUMDiYp1dq8mi27F/5mx+PlOFZFNq5ivxMGKE2Pa ZBJ8VxBTl9Hhm2m7pOOokv0dw/aNvXnvIqIwyttKAKxwxaksdzPr08OUOIJgRuaDfJF6 sN6nMWhu1nnz5rlnMUDAjpSIqUNwA0SLLszvZwbVfd86NJD2FoJvegsDF7y3sgNa4jI5 o4+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=m96YaMQTGjBl6hPvknyKwUDuoQ+EyqlAZy16yN0a1io=; b=OY6wYwBgqTqoxAwuTAC0pZJOdhk3mKIAH62ejsfQVkwtYojGTMmaRdK2t5iXtIhFVo YWqLXFjxeuOJAicoP9njuOyViaF7HjEa3V6eaB9ke0Eup4im9hvaFJToysWByT/+q48B nU6x0in95jEq/Auu0etdT89AITAfwTwPgZS1vQCC9Gl7comdYuUIu704VL6GCm651rwI fwJa8DzOT23BWRDdDULPceme8rh+u4ZO9c4O3Pj2UHKxSJPOOsfZ6tIV2jC279XWd/sX SyznpWDaLNMydLWYVceJB1oxCqONTXJZJqYaVMfYYwpMLlyGVFzem1ecJlvQeZrFcYPD Qbzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="BGSWoz/i"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 82si9872611pgd.518.2022.02.07.05.10.50; Mon, 07 Feb 2022 05:11:03 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b="BGSWoz/i"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377647AbiBDSfr (ORCPT + 99 others); Fri, 4 Feb 2022 13:35:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377582AbiBDSfc (ORCPT ); Fri, 4 Feb 2022 13:35:32 -0500 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6B0EC06173D for ; Fri, 4 Feb 2022 10:35:32 -0800 (PST) Received: by mail-oi1-x22a.google.com with SMTP id 4so9449913oil.11 for ; Fri, 04 Feb 2022 10:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m96YaMQTGjBl6hPvknyKwUDuoQ+EyqlAZy16yN0a1io=; b=BGSWoz/iEyR88bhTN9+03yLlQNu6fnKxt7fN4yOn5317DWTBwK+pKJttKCfyft94+v 6uGri9tDw5N0Vb7hEf21pXwcL71Bjz0NCtbeb2UlAgG2MLEXb2e2G6bUQyqe/2Py691e E125Nkor761il+QHIqyfRpRYo08qcY59RhfL3KyOO1XWbOBek16t2+4eB3bq0bnz5OT/ BlUmv4+erStNi8B49B5e9daC2RLXORdLG3UuHzxLAZtlGyVXSFFisNMvH4nydQ7HeU0h nd/UujjCpNq0yuyf0dCfDsggUVAcUND0V7aIi/5EizskuGVHBdxdHf38hvYCwkYjbqsr f70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m96YaMQTGjBl6hPvknyKwUDuoQ+EyqlAZy16yN0a1io=; b=3aVBFoZlU65/MmeI7gORn3R0FPDjtiThv4R6uRiZ5WIJMl5c2fR+g+ENIAUNLhkRzQ jZ4exF15tsFLHxlm2df4U8wlg1MCXxgciZdKFEZh/acgn/ajh2IPvnsSA5r1j6fiu0WH YMOXA6qD1dPmpkv4peS3t2G805/1mME+pFhIUXsBwa5a92BDu/QprD3kd8aGYcqQ+bhs VIW1ITn7ITaVV1x76uolINVKppX1rTuGLFf56CPV1w1I6ZGktQlNXoOQNclevkYwlKel /l8EXj/haCkMEOcEyZNMZE3Sk5Ni99y5BAGyFOmyaQPvWKhj7FsB8N/Ccm0CS5iQM2+D 0pUg== X-Gm-Message-State: AOAM532Dgr2ca9/G9rtEKbmJrkb0bWp9HzB9lWmmNBeH2KBjqGvVAmaU ASpUH39N+Kjj7cTo45KV71SLwg== X-Received: by 2002:a05:6808:1784:: with SMTP id bg4mr2000994oib.286.1643999732128; Fri, 04 Feb 2022 10:35:32 -0800 (PST) Received: from builder.lan ([2600:1700:a0:3dc8:3697:f6ff:fe85:aac9]) by smtp.gmail.com with ESMTPSA id 100sm1044182oth.75.2022.02.04.10.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 10:35:31 -0800 (PST) From: Bjorn Andersson To: agross@kernel.org, Jiasheng Jiang Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: (subset) [PATCH] soc: qcom: rpmpd: Check for null return of devm_kcalloc Date: Fri, 4 Feb 2022 12:35:20 -0600 Message-Id: <164399969245.3386915.12317625487296679107.b4-ty@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211231094419.1941054-1-jiasheng@iscas.ac.cn> References: <20211231094419.1941054-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 Dec 2021 17:44:19 +0800, Jiasheng Jiang wrote: > Because of the possible failure of the allocation, data->domains might > be NULL pointer and will cause the dereference of the NULL pointer > later. > Therefore, it might be better to check it and directly return -ENOMEM > without releasing data manually if fails, because the comment of the > devm_kmalloc() says "Memory allocated with this function is > automatically freed on driver detach.". > > [...] Applied, thanks! [1/1] soc: qcom: rpmpd: Check for null return of devm_kcalloc commit: 5a811126d38f9767a20cc271b34db7c8efc5a46c Best regards, -- Bjorn Andersson