From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 467FA20967C for ; Fri, 10 Jan 2025 08:52:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736499129; cv=none; b=ukH+b0goAIYdg2kM+PcV0afz3rbVAtFwX00UnCcU76G2TQGEJxs0vbaWIbrXqr5yEDeVN3idQe0Q0CN0QkXxfeH7DBlPFdZHIlze8gAISPJgS4t/OTNH2YWG3PeHg0NLKhsfBHJGjEsdOvz5r8AhByAsjlQeFCzV7NIcLFfHcoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736499129; c=relaxed/simple; bh=ixdOxPMgl+rvG2UQ9iHkx5m5TsEEj49xuw3K+d0WDNA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=B7zKrwRiVbqBuI15AQqHWgeOOFvRQy7LgYXe/9ThxAowtUMbe8EUBFZ66yjP+gwVMeOksLPmdAasvZWhFJaEDInG7tjOFV7/EqJt4PK86wF3HHoUbM9ZdbYW9071LARpsTvaQwdIwnlEobBV0AmS9eDFOeRRjmo1JiJRO2IHyHE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pQYcCJZk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pQYcCJZk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F5C4C4CED6; Fri, 10 Jan 2025 08:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736499127; bh=ixdOxPMgl+rvG2UQ9iHkx5m5TsEEj49xuw3K+d0WDNA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pQYcCJZkd1wzCqClQ/TcTsbCmz57nDjAc/KW5EhUlBXmR8W9jzwCVYRv/YjLXVVwS GYuQs1X2L5sTUtPq5iTNt/2rqw4RjCq0Oi3Pva1ARlBmgmfi6bdrZDOKZHuva+fB4N LdWgTuKoi+eOPzRozgKnX1NqRbn+tU9TLM0jiXJc= Date: Fri, 10 Jan 2025 09:52:04 +0100 From: Greg Kroah-Hartman To: Bartosz Golaszewski Cc: Rob Herring , linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH] uio: uio_dmem_genirq: check the return value of devm_kasprintf() Message-ID: <2025011054-promptly-earful-3631@gregkh> References: <20241202181703.28546-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Jan 10, 2025 at 09:41:16AM +0100, Bartosz Golaszewski wrote: > On Mon, Dec 2, 2024 at 7:17 PM Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski > > > > devm_kasprintf() can fail so check its return value and bail-out on no > > memory. > > > > Fixes: 52e2dc2ce2d8 ("uio: Convert a few more users to using %pOFn instead of device_node.name") > > Signed-off-by: Bartosz Golaszewski > > --- > > drivers/uio/uio_dmem_genirq.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c > > index c70dd81bfc61f..31aa75110ba59 100644 > > --- a/drivers/uio/uio_dmem_genirq.c > > +++ b/drivers/uio/uio_dmem_genirq.c > > @@ -167,6 +167,8 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) > > } > > uioinfo->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOFn", > > pdev->dev.of_node); > > + if (!uioinfo->name) > > + return -ENOMEM; > > uioinfo->version = "devicetree"; > > } > > > > -- > > 2.45.2 > > > > Gentle ping? It's in my queue. The "fix up an error path" patches are on the bottom of all my reviews as generally they are a pain to review as it takes a lot of out-of-band code reading. And they have a bad history of being wrong. And they are really low on the priority as they really can't be triggered :) So I'll get to them, but realize that they are a pain to deal with... thanks, greg k-h