From nobody Mon Feb 9 16:01:39 2026 Received: from mail-43102.protonmail.ch (mail-43102.protonmail.ch [185.70.43.102]) (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 5E3D7285CAD for ; Thu, 15 Jan 2026 19:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768504835; cv=none; b=JnFT7rc1iNXWFbxYYm7g2KVIB0B8eH5QNI+ciiye0rAjMRkNZB/9vaQzfd09BTPlyRYkaiBcQXHALlSH4PX66cOX4znm+XjtawV9OO3WNB/KQ6lliQt5K99XZYRIc1PKIFl5SYmURiLucU9m95YI29V4K8PxoGgeqcXFvJFcn9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768504835; c=relaxed/simple; bh=u/J7qcGF5yMjT+HR6mzTXEFVnqb3SAITNcLOk4Daj80=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SeGheJewOev3R0Y0o/LT+6wWLPyy+iY+WNSogp1GlZtowO58bBp/umVol7xhdnUY0FJbUvJrynOPJRr/yKVcAeyo2XSmFP1G0qwxnxUvEtmp2NhsqNwekAmTdzvS9yaPGVE0HLvYDjwVitf+s47xTX37fds5LHoMyUX07rCtn+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=FIvZPeC3; arc=none smtp.client-ip=185.70.43.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="FIvZPeC3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1768504825; x=1768764025; bh=u/J7qcGF5yMjT+HR6mzTXEFVnqb3SAITNcLOk4Daj80=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=FIvZPeC34DU+c1Hj11mwwNWuK96Dx42JTx80yf6wy23etLR9h7xxCrsvI0IwnN/KP ZMV3lMlpIaMk4OOx+XOwwD+Q4B+pzHA0uK6++K0xqdwq0p21XKN0VqqOenBTP8wqJY JYIq0XtEEUv4KrE3tgGHMm0AkD2PbwzX/rjJZKAX7rhwZZ1g8aiMvbu4oUe0h9W1wm og/Vkx7X1TGhHgkkD0qMAlUKuaPpTQyLuiFIevACj6xio9L16/jhltx7NgflXsjw3u ZoksdTwL52ouv6qVAFDAL86FQp7K0Jr9jASVRMGMeSJ0VnTSq/mzBSWIolUJQzwOTv iY8lxGpH0Hoqg== Date: Thu, 15 Jan 2026 19:20:20 +0000 To: Dave Penkler , Greg Kroah-Hartman , Michael Rubin , Dan Carpenter From: =?utf-8?Q?Dominik_Karol_Pi=C4=85tkowski?= Cc: linux-kernel@vger.kernel.org, =?utf-8?Q?Dominik_Karol_Pi=C4=85tkowski?= Subject: [PATCH v2 04/12] gpib: eastwood: Unify *allocate_private Message-ID: <20260115191925.52268-5-dominik.karol.piatkowski@protonmail.com> In-Reply-To: <20260115191925.52268-1-dominik.karol.piatkowski@protonmail.com> References: <20260115191925.52268-1-dominik.karol.piatkowski@protonmail.com> Feedback-ID: 117888567:user:proton X-Pm-Message-ID: fd91804c2e563c11ed96ad71ab31a0326f49d00e Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Return values for *allocate_private functions as well as calling code in gpib driver are all over the place. Unify them by returning -errno if something fails, zero otherwise. Use the returned value as early return value in case of error. Replace kmalloc/memset pairs to kzalloc. Signed-off-by: Dominik Karol Pi=C4=85tkowski --- v2: Replace kmalloc/memset pairs to kzalloc. drivers/gpib/eastwood/fluke_gpib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpib/eastwood/fluke_gpib.c b/drivers/gpib/eastwood/flu= ke_gpib.c index 3ae848e3f738..8e315b0e35a2 100644 --- a/drivers/gpib/eastwood/fluke_gpib.c +++ b/drivers/gpib/eastwood/fluke_gpib.c @@ -853,11 +853,10 @@ static int fluke_allocate_private(struct gpib_board *= board) { struct fluke_priv *priv; =20 - board->private_data =3D kmalloc(sizeof(struct fluke_priv), GFP_KERNEL); + board->private_data =3D kzalloc(sizeof(struct fluke_priv), GFP_KERNEL); if (!board->private_data) return -ENOMEM; priv =3D board->private_data; - memset(priv, 0, sizeof(struct fluke_priv)); init_nec7210_private(&priv->nec7210_priv); priv->dma_buffer_size =3D 0x7ff; priv->dma_buffer =3D kmalloc(priv->dma_buffer_size, GFP_KERNEL); --=20 2.43.0