]> www.infradead.org Git - users/jedix/linux-maple.git/commit
devres: Fix devm_krealloc() wasting memory
authorZijun Hu <quic_zijuhu@quicinc.com>
Tue, 2 Jul 2024 14:51:50 +0000 (22:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jul 2024 10:34:38 +0000 (12:34 +0200)
commitc884e3249f753dcef7a2b2023541ac1dc46b318e
treefc8377fee1d9694dbc7174a87eb8a0156f2d721f
parent23c6859677066fa3d6bb3672703636dd673cb5dd
devres: Fix devm_krealloc() wasting memory

Driver API devm_krealloc() calls alloc_dr() with wrong argument
@total_new_size, so causes more memory to be allocated than required
fix this memory waste by using @new_size as the argument for alloc_dr().

Fixes: f82485722e5d ("devres: provide devm_krealloc()")
Cc: stable@vger.kernel.org
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/1719931914-19035-2-git-send-email-quic_zijuhu@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/devres.c