From nobody Mon Feb 9 19:53:31 2026 Received: from mail-244123.protonmail.ch (mail-244123.protonmail.ch [109.224.244.123]) (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 AC3312F1FF1 for ; Thu, 15 Jan 2026 19:21:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.224.244.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768504870; cv=none; b=maDu7+tIdUl7fftS4pLMKxb88n+JgD3dJ3k+cjdRatdw7JgMwDuO95QWZo78XlWaUDEWlzIP6PxWrQrGfRwWMA9M9euASH+uhfi+hTM1gyp+x1oc4SIJCewFr3jH8UzUokt6n325GwezmasXBZytFhO7ICo+N+K8Z35VsPq3Vco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768504870; c=relaxed/simple; bh=QsZNlHEoZ0o3k+eO4+9uP0dblXpelHfHww6MTTJU1gQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ti0sq/ebsjVyUxE2ZlAOvcIe5UGaXWzsVvUpwT4ZRq7lxBmQwgdOSvZaKXuH0aasUNbR512PmbdC4oG0LjgQ/g9tfBiHJ5oZ0AmIWYnFegfTOA0/m1exJr5YIt5CRG2sTmy7XowWRtaK57frLl8lVDPxnJd8tmj8dZrxiNx+1+o= 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=hGguYdDr; arc=none smtp.client-ip=109.224.244.123 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="hGguYdDr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1768504865; x=1768764065; bh=QsZNlHEoZ0o3k+eO4+9uP0dblXpelHfHww6MTTJU1gQ=; 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=hGguYdDrVMbrukwS6gXajSolrG/XKNS937R6wDeRa98DDJy6TABAVmjqIDbo1TJu7 AarqVk/UfsqrEocMyzW7ADSB7ipGfDyXL+NUTviZXb6NOiwdIZApVnZKfayr/0G6B+ 63VY+uZwqrd1ukPWcY7E22an1UiZSgFro13R3MHd8xYdIYDrEFn9ML64NR3TgtYVMk tNmi+OldP05Y/29FxoHrNbzauj4GdliUSxbJtv7WmzB7pG17fhV0iExM2PH5quOoXO AQbG3YhY/lv2Asr0U4e2C4NDJhlwFXZ0CZiImZs5B1J86XD02CjrNog4qZXT/iwy/E KheffjCoYu5gg== Date: Thu, 15 Jan 2026 19:20:59 +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 10/12] gpib: ni_usb: Unify *allocate_private Message-ID: <20260115191925.52268-11-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: c2740659e0edd693d0c6865a0b2709af4f0c658b 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/ni_usb/ni_usb_gpib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpib/ni_usb/ni_usb_gpib.c b/drivers/gpib/ni_usb/ni_usb= _gpib.c index 1f8412de9fa3..1fc3ccdebff1 100644 --- a/drivers/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/gpib/ni_usb/ni_usb_gpib.c @@ -1659,11 +1659,10 @@ static int ni_usb_allocate_private(struct gpib_boar= d *board) { struct ni_usb_priv *ni_priv; =20 - board->private_data =3D kmalloc(sizeof(struct ni_usb_priv), GFP_KERNEL); + board->private_data =3D kzalloc(sizeof(struct ni_usb_priv), GFP_KERNEL); if (!board->private_data) return -ENOMEM; ni_priv =3D board->private_data; - memset(ni_priv, 0, sizeof(struct ni_usb_priv)); mutex_init(&ni_priv->bulk_transfer_lock); mutex_init(&ni_priv->control_transfer_lock); mutex_init(&ni_priv->interrupt_transfer_lock); --=20 2.43.0