sh: sq: Fix incorrect element size for allocating bitmap buffer
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Wed, 19 Apr 2023 11:48:52 +0000 (13:48 +0200)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Wed, 19 Apr 2023 13:55:30 +0000 (15:55 +0200)
commit80f746e2bd0e1da3fdb49a53570e54a1a225faac
tree844e575d084e0c2f7e850cbc7e7075fb19ab2c43
parent63f148c44f3919047301a023b10b0e3ce65a7389
sh: sq: Fix incorrect element size for allocating bitmap buffer

The Store Queue code allocates a bitmap buffer with the size of
multiple of sizeof(long) in sq_api_init(). While the buffer size
is calculated correctly, the code uses the wrong element size to
allocate the buffer which results in the allocated bitmap buffer
being too small.

Fix this by allocating the buffer with kcalloc() with element size
sizeof(long) instead of kzalloc() whose elements size defaults to
sizeof(char).

Fixes: d7c30c682a27 ("sh: Store Queue API rework.")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20230419114854.528677-1-glaubitz@physik.fu-berlin.de
arch/sh/kernel/cpu/sh4/sq.c