Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1132464rwd; Wed, 31 May 2023 09:51:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wNDWO1nOXjqbv6UZky9WZiqeHz6rgTA5UxF+kkTvgi0/pHj8gqj7Nyy3T81qrOoh18dw5 X-Received: by 2002:a17:902:d492:b0:1ae:29a8:d6d0 with SMTP id c18-20020a170902d49200b001ae29a8d6d0mr5739717plg.59.1685551875768; Wed, 31 May 2023 09:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685551875; cv=none; d=google.com; s=arc-20160816; b=0z/qRccLAKBGROBl/EmCdlSMPTV0k9xP/hHXFf/j6HjgbGop487AMlaJXcGPpBTrpd dyiANFLedKKjsAY4EVU0Zje4ykTHTUC1C1qMxB6JEUuoZMkCZ7WVfHtuWvdfcgq6C6rG JuBZrw2mY5rnXIxB4wpMWn5TP2JfGtllEgg3DHBqXoZTLiXZp+kDky0vdgiwJ7aTZ8Gv VyzpM70Rbd6ofCtwnqicjniJUig2/WgDadIFJEL+Z0DvJanwYsUzai+qro59KG+PyK2D I3LifTWxuRCb31nZV2lUF3P6YEr01pd9XCF5I+rC4mX1L9afNN7VMSL6ngeQxt61g0JO qK5w== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=CuEjCfYrSXwpkGNWiwpt9RfeE5fAvVGA+wyh8qN+kyk=; b=C57cWD2qoPVN/KOcnE/0xHkB8+bZheVL6P5ttkNj7dij8TvjCk/1Weaos5VrfIK/0M kwpM1dbkMsroTtip+udBPBxhxbAE9GcQgSPnXje2JzSvJtWLaV/D651TE09sZv7UKpyw YVXzMcguJ75WvlvqKFqOSRhcz2PYfqpgMfZrK9qs/h6yZpDle75NFE3UoMtZvOJoVpbd SNyxBfqfXDV4FvIjWe4wINy8kzxKO8Fdm+ZNSjzf7RHzWO2BO1wfP+ZVMMViyvc92I3R VShYFqRuPeAN2k8j54QZiKol0oFkTX7HywklAazGcho6J8THKSfrPdtyuD8YBrMbcLTw fGWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CIkzXrTB; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a170902788500b001ae67aab6a6si1132403pll.172.2023.05.31.09.51.03; Wed, 31 May 2023 09:51:15 -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; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CIkzXrTB; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbjEaQdL (ORCPT + 99 others); Wed, 31 May 2023 12:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbjEaQdF (ORCPT ); Wed, 31 May 2023 12:33:05 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1394098; Wed, 31 May 2023 09:33:03 -0700 (PDT) X-GND-Sasl: luca.ceresoli@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1685550782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CuEjCfYrSXwpkGNWiwpt9RfeE5fAvVGA+wyh8qN+kyk=; b=CIkzXrTBevFhycdDTUYWl1lxs9WC4SxZMisyMnxKJOwtwChgHNHdQnW6OiLV0DlxtzCQlc 8nvkEAEzHHpJxKnyXPEQTmiyfbjIXa04F2RoWRQKb3yWdIOk0bJ5k8ND73opRq0+eSRIDb AG/sQs1M7a/M+UWbjUHedVWNJCXF8u5VrsGHjv+micSoLQTQ4F3wuOwnIQ1eNQrr/XSpgf HEsjdmqaC/eaYqToLd/2J8gVOdL6ZnXM3m0wsW7iqmbgElHMyG+aDWikV46ewa4yA5M9wI V4lxNGNWuFN4WS5FXUWJQpjXQhUgrlqb0d8P0IHLFcdEaGHiP2LpHrLk7GYDSg== X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id C81B220009; Wed, 31 May 2023 16:32:57 +0000 (UTC) Date: Wed, 31 May 2023 18:32:56 +0200 From: Luca Ceresoli To: Claudiu Beznea Cc: , , , , , , , , , , , , , , Subject: Re: [PATCH 1/8] clk: vc5: check memory returned by kasprintf() Message-ID: <20230531183256.48e1b893@booty> In-Reply-To: <20230530093913.1656095-2-claudiu.beznea@microchip.com> References: <20230530093913.1656095-1-claudiu.beznea@microchip.com> <20230530093913.1656095-2-claudiu.beznea@microchip.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hi Claudiu, On Tue, 30 May 2023 12:39:06 +0300 Claudiu Beznea wrote: > kasprintf() returns a pointer to dynamically allocated memory. > Pointer could be NULL in case allocation fails. Check pointer validity. > Identified with coccinelle (kmerr.cocci script). > > Fixes: f491276a5168 ("clk: vc5: Allow Versaclock driver to support multiple instances") > Signed-off-by: Claudiu Beznea I think this driver would benefit a bit of refactoring, moving all those similar sections to a single function. But for the time being your change is fine: Reviewed-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com