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 02B7CC7EE2D for ; Wed, 31 May 2023 16:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229725AbjEaQdN (ORCPT ); Wed, 31 May 2023 12:33:13 -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 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