From patchwork Mon Dec 25 10:18:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 183167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp323631dyb; Mon, 25 Dec 2023 02:18:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrcqynNmdyhDNaPGz0dks6KN9C0nQaTaj1hIhQGPPCtbMwJBZ5pxXzTsFG5s73yizp9Gni X-Received: by 2002:ac8:7f0c:0:b0:412:c2a:eaef with SMTP id f12-20020ac87f0c000000b004120c2aeaefmr7355554qtk.11.1703499539024; Mon, 25 Dec 2023 02:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703499539; cv=none; d=google.com; s=arc-20160816; b=jIfjWpPUyzO+54UJth7W9NK5sAnrLX1nMErBiV9x7qxaMMyGUpyf2hiyRdpxmmUJ/b /1h2EZD+yHQyJiGxE0GW/6RGRIeUxL5cccjV16TRv4mOIQOHMgFNRf4yWl3Auv+/0R91 2xt75EN+BPU0HS1gD/k99vgWGCI1pFJ/vmjHkxMiaveZlGZE+jolw4XdRyYrvdpJfsW9 eNN4EsprOsEUbk84zCYPfnO5u7x7mSv+tGEhO6ot8fwFa2v2+Pp/8eza6vbJscKPiGG5 gvxjvnCdeRaeZ0fUBehyFzbw2zJbE3TXixnxatAlPl9YIRH/AYmyzIIrjHVc6zwbrZns dfrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=ySWAI4kP7vmZs3Y+VlnIHKgTIesun+Yl241EM1zS2CU=; fh=ksZansD5U+4SwnCe5XSfBs20ubp6qS0cOKRNB4rLVWY=; b=u7ysI8nULsvJ0IJJRcEAdZsEUhfYXjcYkYh7wt+Ep3jcrHmGLMx7uEt5EARViwZ/tK NOfuAOtocQy3DJLpa6G9g5x2E7HvJk0BHo0iOvAWu7HWt9AqXpT6wHazMFFlzI3H/Ti4 8Ik9OzEis3Jw2HLHXAzGCbhTAulRNzbDeJ/2xCVrNb74ynBAv6QnKzmoVpbss5YAOdm9 7xUBQXCQEAayb5NeIzGjJhXH/AlRgexUmeDVqnAl1l44dwiqkfoqvgHsNTBtQ39j21qS SESlaCqtfz0qgNrXg0Fc4S0DUTnxqtHA9QPlI0RtJPmgleLXY3Vm0ZzK6YCdtnJHaWzv PsOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=AqR1cWYt; spf=pass (google.com: domain of linux-kernel+bounces-10984-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10984-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z12-20020ac87f8c000000b0042790b60db2si9801709qtj.620.2023.12.25.02.18.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 02:18:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10984-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=AqR1cWYt; spf=pass (google.com: domain of linux-kernel+bounces-10984-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10984-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CB4891C218AE for ; Mon, 25 Dec 2023 10:18:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FF8E35F12; Mon, 25 Dec 2023 10:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="AqR1cWYt" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.web.de (mout.web.de [212.227.15.4]) (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 CF0D41D683; Mon, 25 Dec 2023 10:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703499511; x=1704104311; i=markus.elfring@web.de; bh=HUXBB4x97jqAAp/XJdLxZnTbCwGahqmDUfoq0o7TY0Y=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=AqR1cWYtd7+eKcVdEjj1jDRU90bU3sIoJYTdsYIuRUHa05DCoczn9hKRkw35Sd9n aV8azjz4esk7zxbfKkfzLsweIPy6Qph8ZtGvVNZhTjtB1r15Dczg9C60qNG1V+51Y POG+U6YcjzhEOVyzx3BebImbfBjg6JfGuBOvdWmZ8j6sfbyEZz477gA1v1DB8dMLe 7r5cfIdT4rGRWcrbW2vwYkTeeAUoZaQx79m80HJXbeIkVuNmazK8UakCL0xuyZSb7 XOIpdxXRmdBYAQU4VRnVWl+vtbKytqFtpvpDYaAF31y5C0OorWpuZzDgOhRzSHcvg wWuzCg6+vbxJVBSnEg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M2ggd-1rGt5s2LFf-0040rC; Mon, 25 Dec 2023 11:18:31 +0100 Message-ID: <4b7b5eed-d00e-43ea-afb6-1f563fb2577c@web.de> Date: Mon, 25 Dec 2023 11:18:30 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 1/3] dmaengine: timb_dma: Return directly after a failed kzalloc() in td_alloc_init_desc() Content-Language: en-GB From: Markus Elfring To: dmaengine@vger.kernel.org, kernel-janitors@vger.kernel.org, Vinod Koul Cc: LKML , cocci@inria.fr References: In-Reply-To: X-Provags-ID: V03:K1:kzWqifzdC9upknspVDEsGqa/iK/LiQ+tcH1RpaEvLdJZMpNhh8m Ys3H+MVK7Ztd9cpyz3ZRXbetOfAcRVo9gGT610atXbS+5HOqpzQGP5DnFvMwwD5u6hGRd43 cJWIpvazYhfCVaSo0wYwQVMyf6y5Vj7iFNG1UxATRmzUMKUKQBIRgr+/uUh3IyJEk54a6fr UouIH+E8jv+jvI/c31o3w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:5WXMyCpU9ac=;VbG3CJm/62DrSyXNdzthHO8TcpT 1/uF+efGVkVTZz2xgTh5sY0R6uotfXQmiFkdOgVyajsiF+N+eIpvGq+NM0Oblg5N42D3JPXJw G8qveNjhgONtQUfwxRGkj3FoxPFP0IcY/9DKhwTZnVZm6TF5RS6K/rzKLdhJE8gjq2zPiYnUV Hsp/D31XyTekbDwyLI2/PpiIfadDn8h78MJeM/6H8fhF0l1ZPEuJjgZ37J9nDPOlIWnIFKOXV 1jz2dbJgkHOKlpIYC0Yclg5rBAMb2RF+td8Q55B32MP6vaVdmsciELyDPmOPapizkp6My3xeS MhaRjvCPIx8UJV6iX1wx7V3VQ6CbSNKHo5HL4WaIUAlMprgkMwKBSsV6QIiW75gqEggWma/xE HuSewG2EsF5XXtL4hgefQUp0VZTAlYjZ2SjGKlYfnBMapMVeMXd28mktGq84vXoeXTXTE1hmk 6zNVaEQFiRjBNP+0/ROnI0RZcukdBO7MGDFNaUXuWFwHFXGcUv2crddDd0XHifljTLhp8mA9p vu2pp7tcSHbX11EpkQ9ELuQ26wiApMbj3uwJyWd6vpyjqakbgjnrCM6zS1Umw+6Q0NIVRne9y gDJGsC/javSUel4AmlNnnuV+Kdhd25qiluARVGS+zw46nLWEyfrxsFFwalmR/SIayFLv1l5Bi bYy02+KYi6oQOCaWLcsbPJpUusCn7jMyvBaxA65kvsqLqxb1wYcMeT/xstXng3HbW36iYWotn kkIa8miKrk0X4LfSPnYnTeqqfOQFyHZwlNLj2ba1vyYhju5BpBtrjfeZ4u7C7dcvhJlvJMAJR sTdY6TNNnxbMl7gbYnNZnzfH4OC8f14PLMpY7WtkEIUkMqTQOtnlZnn67bjwD1357BNZw0CrN 71IWRzpxX1Y/jm7kBI9vwbSwH8sFKO6ehNJr2kSvnsILHmFsKAD0z4ODF6SRyaKZp06UA4wo/ vAVJ9Q== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786248732836657793 X-GMAIL-MSGID: 1786248732836657793 From: Markus Elfring Date: Mon, 25 Dec 2023 10:40:12 +0100 1. Return directly after a call of the function “kzalloc” failed at the beginning. 2. Delete the label “out” which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/dma/timb_dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.43.0 diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index 7410025605e0..abcab0b1ad3b 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c @@ -327,7 +327,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan) td_desc = kzalloc(sizeof(struct timb_dma_desc), GFP_KERNEL); if (!td_desc) - goto out; + return NULL; td_desc->desc_list_len = td_chan->desc_elems * TIMB_DMA_DESC_SIZE; @@ -352,7 +352,6 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan) err: kfree(td_desc->desc_list); kfree(td_desc); -out: return NULL; }