From nobody Tue Feb 10 00:58:41 2026 Received: from mail-106121.protonmail.ch (mail-106121.protonmail.ch [79.135.106.121]) (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 32F022EBB8F for ; Thu, 15 Jan 2026 19:21:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.121 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768504869; cv=none; b=qcV/1hNkPM7FtlkbwBweWLWIh2l6ekR3liB4YA96PBeRNwK9SlgjG9ZRSn/AnpsZXnXtzyduzFDkDRCmRWGOKkpMXgmbOtpabyHwotpjOZkpLaU20z26y2k0i21K1bJ7ZS4/CmOQD3V9Ggtw1PhIFTceR5UMlMkxhkQApOFltFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768504869; c=relaxed/simple; bh=ErfYa5t20LApzoyfyOzE8LGLIBbaj9hN+6E8Q5cAuGM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u/V1I6nSmWsHxccjiRvX2nD28GPS2EqWZ+4bn38yUHP/dACtNwk7iFvWLTAiKoj53Q1duE1+VC1Z8Gm4nGa1f8mE60yxqlqSo5aExkVMXAzjaaDOyPL2clwR8EUa2mfceHK1M4bAVv1cDyZuvHCx0VSOZduB8Ncsx8T/QteSvSo= 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=R/BdyaIQ; arc=none smtp.client-ip=79.135.106.121 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="R/BdyaIQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1768504857; x=1768764057; bh=ErfYa5t20LApzoyfyOzE8LGLIBbaj9hN+6E8Q5cAuGM=; 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=R/BdyaIQK4502IwGKPImm0C45I9E1gdjmwwDacXk4n7B0C4qcMoYzUPzpX2pjRJjf oL4yJoZG1bW7lVb/T4VDVzDPY/RhEbQGA/Q/bJbzUXt1LUTFVNGcIqkaHs1wJqcQbB fngEoousHTDg0TCJjhR3axjURLamk13/YNU34oDUt1jfn4oiIV3y7A2ioqL+NI5hVO 8bSffCua9v6qFCXiVtqTSiX6DU//lAZnzQxqMFH6k81QR8bI3atzVjlnLLfb58MJ5i L4hViAO50hbSxlhhs4wSFeb3LDlq8nJE6XlwZeNtOPA6KFlfO4gdtXHr1qW/Scg8dz twdhhOIGqOThQ== Date: Thu, 15 Jan 2026 19:20:51 +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 09/12] gpib: ines: Unify *allocate_private Message-ID: <20260115191925.52268-10-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: 5f55473ab325aa6ceeea3c12b6d9edbf6bce56e3 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/ines/ines_gpib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpib/ines/ines_gpib.c b/drivers/gpib/ines/ines_gpib.c index a3cf846fd0f9..4a87c79f218b 100644 --- a/drivers/gpib/ines/ines_gpib.c +++ b/drivers/gpib/ines/ines_gpib.c @@ -657,11 +657,10 @@ static int ines_allocate_private(struct gpib_board *b= oard) { struct ines_priv *priv; =20 - board->private_data =3D kmalloc(sizeof(struct ines_priv), GFP_KERNEL); + board->private_data =3D kzalloc(sizeof(struct ines_priv), GFP_KERNEL); if (!board->private_data) - return -1; + return -ENOMEM; priv =3D board->private_data; - memset(priv, 0, sizeof(struct ines_priv)); init_nec7210_private(&priv->nec7210_priv); return 0; } @@ -676,11 +675,13 @@ static int ines_generic_attach(struct gpib_board *boa= rd) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; + int retval; =20 board->status =3D 0; =20 - if (ines_allocate_private(board)) - return -ENOMEM; + retval =3D ines_allocate_private(board); + if (retval < 0) + return retval; ines_priv =3D board->private_data; nec_priv =3D &ines_priv->nec7210_priv; nec_priv->read_byte =3D nec7210_ioport_read_byte; --=20 2.43.0