accel/qaic: kcalloc + kzalloc to kzalloc
authorRosen Penev <rosenp@gmail.com>
Wed, 1 Apr 2026 22:06:43 +0000 (15:06 -0700)
committerJeff Hugo <jeff.hugo@oss.qualcomm.com>
Tue, 12 May 2026 16:20:40 +0000 (10:20 -0600)
commit6101f78b684895d5860a96322e607e0f46f433ad
tree5c6a23dfa93061311c694a4806d1702bcc43467f
parent5dd1ff95c623b8118ccaae3242119b8552f7b98f
accel/qaic: kcalloc + kzalloc to kzalloc

Consolidate the two-element allocation into a single allocation using a
flexible array member. This reduces memory fragmentation and simplifies
the error path by eliminating the need to check for allocation failure
between the two allocations.

Add __counted_by for runtime bounds checking.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Tested-by: Youssef Samir <youssef.abdulrahman@oss.qualcomm.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260401220643.12802-1-rosenp@gmail.com
drivers/accel/qaic/qaic.h
drivers/accel/qaic/qaic_drv.c