From nobody Thu Apr 9 09:25:49 2026 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 7765F337B9D for ; Mon, 9 Mar 2026 22:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773095699; cv=none; b=Bk/Tc8F7oS6iIXma84hqUEpWnhVG6aTOLeI9OD0o27qTxTUeVa4uW2I1oCa00n53KxNwXI9T3DPWdMScMp7HOH96Z4vcGZIqNW9/+Mz95hal16Fcq+UZA8HdaZjLdohV7vPpBM5c7ZcG1v8lcQ+l/QtMq71+o907O/QEr+UWieQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773095699; c=relaxed/simple; bh=2YI8FiiLw6phzU33JUxAwPc1QtlmsT4tOtoXDtkee4Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UsSDufaG9x+w86/xthEMrH2wJ2OrzqeBRzC1pHf2rVyJ3ZOh8mhX34cuaRHjhyIEhUczsyH75eeKy9Z8fVYv5eV5hIjvgUTeuP8suqRImZcuoBf72bhtiBeJ0ZwHWqFXjFcLS5Bvp1XDYbzQ2/dDN0oMU6XeCV2dpTYYX5HAykk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=l3oFRHqv; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="l3oFRHqv" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1773095695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Shv05OhSLbwUt09Tn3aPYluLjWcR8cyC33l6MNe4YlE=; b=l3oFRHqvzPtMZDJjq8B7BrCzPXp+ITGxaKOhQbYvPODXcDw9pB5i2WQrF8PQWEopp78Icq Hqn67y4Fr4Ey/1oYod48/HxGhZ6B6na1kOeb5TcjJu4Swgmz+akDhMELkJwkmEwrulv6tg r2VodeX93HdTdQTyjf1PwSFfzuxwnfM= From: Thorsten Blum To: Parthiban Veerasooran , Christian Gromm Cc: Thorsten Blum , Kees Cook , linux-kernel@vger.kernel.org Subject: [PATCH RESEND] most: usb: Use kzalloc_objs for endpoint address array Date: Mon, 9 Mar 2026 23:34:24 +0100 Message-ID: <20260309223422.83659-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1153; i=thorsten.blum@linux.dev; h=from:subject; bh=2YI8FiiLw6phzU33JUxAwPc1QtlmsT4tOtoXDtkee4Q=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJnrvd5dylkeMqfxreajyeavJzz+GRk2TVCwMNxTVdSuY 0pNFgNjRykLgxgXg6yYIsuDWT9m+JbWVG4yidgJM4eVCWQIAxenAEzEpJCR4bBm7PnbrWp6H6J0 59v+EQ07+qS3N/j3IespS3YkR/pnvGFkeOrhebbhdJCI6pHdUibLNsWffi3m0PC+9pIR0/aY9h3 C7AA= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace kcalloc() with kzalloc_objs() when allocating the endpoint address array to keep the size type-safe and match nearby allocations. Reformat ->busy_urbs allocation to a single line. No functional change. Reviewed-by: Kees Cook Signed-off-by: Thorsten Blum --- drivers/most/most_usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c index d2c0875727a3..6437733afee0 100644 --- a/drivers/most/most_usb.c +++ b/drivers/most/most_usb.c @@ -1009,13 +1009,11 @@ hdm_probe(struct usb_interface *interface, const st= ruct usb_device_id *id) goto err_free_conf; =20 mdev->iface.channel_vector =3D mdev->cap; - mdev->ep_address =3D - kcalloc(num_endpoints, sizeof(*mdev->ep_address), GFP_KERNEL); + mdev->ep_address =3D kzalloc_objs(*mdev->ep_address, num_endpoints); if (!mdev->ep_address) goto err_free_cap; =20 - mdev->busy_urbs =3D - kzalloc_objs(*mdev->busy_urbs, num_endpoints); + mdev->busy_urbs =3D kzalloc_objs(*mdev->busy_urbs, num_endpoints); if (!mdev->busy_urbs) goto err_free_ep_address;