Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5399385rwb; Mon, 21 Nov 2022 22:30:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7UDNdZ7dxYkS1dWKz+/xVFpOmtEOYP2j6xySfmGWHjLZ0q98iA4SI09RmFsXLSDRqT5UE0 X-Received: by 2002:a63:121a:0:b0:477:6ccb:9f1d with SMTP id h26-20020a63121a000000b004776ccb9f1dmr2535104pgl.537.1669098603779; Mon, 21 Nov 2022 22:30:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669098603; cv=none; d=google.com; s=arc-20160816; b=PA2LTbK2z5IaezqlKS0VwALMVtaT8AGHXmDRcp5WiID6/4PoSgMUb3EBEn1ssW09VD 8zn4CfNzwlhug5eRUDxi0w7OpeG/jaHBrmxk6UqTkJqWIyLmB1YMhwmIO5d+3Iyjh71p L45n7WJl92Hr58lASE8vngJmDTcXAKrkrL+WtYzW721AlmzaF7YWf364BncaWI8eBNus DSUB7s7wO8NkhTag1kxs6woZUo96AG0xttIlfU7P2CY+gKtuVn+v2Gvwl6XjAe9p8CCZ OejMVZE1XFW+l5M0qL6vrdqcW8L/LvUTYt+BMPughSkuYxwSNoa5Va2Dr5IsryKSHEw1 /Y/g== 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 :message-id:date:subject:cc:to:from; bh=WfKej6e6ENeUXZVjJms2tsjaP8mSWptm7vIoI/eClQw=; b=cpScTOf7o89g9qXmubRuw7hl+mg8tU4RfbxTobpFuiDnUFo2jiSS4Qc25yb2FiEgzv MblcWdK/6EOBoBIYQELYZ5WoU+HDMOh45XXcX9oSqQJYfNwiHEbibVCAWlBar7NBuBsj EP+pK9a251xNEfXsAj4ntG6NWEG4Twa3vKJAP0Xym5Ch4NQ4RcyYDpzDOnxiCdv8mtpE pHCJfgFg+vuWkRxk30U7q85UgpNZLvg1xjvjUah7aZNDhrhn4FUfg+WZaYEiPhu9QARF GUBSaEEkzGuVIQI2JiyAUJCpq6aG5YWtTVMEaMNc51BRhL0XcofWTFZeqVWNym+/Zzq8 YEkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp7-20020a17090b4a8700b0020d457c5083si19476185pjb.147.2022.11.21.22.29.43; Mon, 21 Nov 2022 22:30:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232159AbiKVG2e (ORCPT + 99 others); Tue, 22 Nov 2022 01:28:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbiKVG23 (ORCPT ); Tue, 22 Nov 2022 01:28:29 -0500 X-Greylist: delayed 346 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 21 Nov 2022 22:28:26 PST Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7BCD18B09; Mon, 21 Nov 2022 22:28:23 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.125]) by APP-05 (Coremail) with SMTP id zQCowADHzPSnanxjH8a_AA--.29968S2; Tue, 22 Nov 2022 14:22:32 +0800 (CST) From: Jiasheng Jiang To: clabbe@baylibre.com, herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-crypto@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] crypto: amlogic - Add check for devm_kcalloc Date: Tue, 22 Nov 2022 14:22:30 +0800 Message-Id: <20221122062230.22024-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowADHzPSnanxjH8a_AA--.29968S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Gr1Utw1DCryDWryxArW5Wrg_yoWfZwb_Ca 97uFn7XFWrC34kJrW3JFy7CryFv3W5Wa4kWr4ftF1Sy3sFyryUuF1a9ws8urZ7CayUArsr GFZFvrWYv34xZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbwkFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r106r15McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48J MxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwV AFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv2 0xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4 v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AK xVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbd-PUUUUUU== X-Originating-IP: [124.16.138.125] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ 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-crypto@vger.kernel.org As the devm_kcalloc may return NULL pointer, it should be better to add check for the return value, as same as the others. Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL") Signed-off-by: Jiasheng Jiang --- drivers/crypto/amlogic/amlogic-gxl-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c index 6e7ae896717c..b243d6382664 100644 --- a/drivers/crypto/amlogic/amlogic-gxl-core.c +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c @@ -238,6 +238,9 @@ static int meson_crypto_probe(struct platform_device *pdev) } mc->irqs = devm_kcalloc(mc->dev, MAXFLOW, sizeof(int), GFP_KERNEL); + if (!mc->irqs) + return -ENOMEM; + for (i = 0; i < MAXFLOW; i++) { mc->irqs[i] = platform_get_irq(pdev, i); if (mc->irqs[i] < 0) -- 2.25.1