]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bus: mhi: host: Use kzalloc_flex
authorRosen Penev <rosenp@gmail.com>
Thu, 12 Mar 2026 04:59:21 +0000 (21:59 -0700)
committerManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Tue, 17 Mar 2026 10:04:47 +0000 (15:34 +0530)
commit37a23d6f11938cd59927e3307b9b301624df8e8f
treef1868b625d2fc8ed1e16e3a5805f2378f66fd184
parentf227b246307e0cf3091e13e7fbae3974aaf38eb9
bus: mhi: host: Use kzalloc_flex

Change kzalloc + kzalloc to just kzalloc with a flexible array member.

Add __counted_by for extra runtime analysis when requested.

Move counting assignment immediately after allocation as required by
__counted_by.

Move mhi_buf definition as a complete definition as needed for flex
arrays. It's not a pointer anymore.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[mani: squashed https://lore.kernel.org/mhi/20260317-mhi-invalid-free-mhi-buffers-v1-1-8418a3ad604f@oss.qualcomm.com]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260312045921.7663-1-rosenp@gmail.com
drivers/bus/mhi/host/boot.c
include/linux/mhi.h