Re: [PATCH] sh: sq: Fix incorrect element size for allocating bitmap buffer
Geert Uytterhoeven <[email protected]>
| Newsgroups | gmane.linux.ports.sh.devel,gmane.linux.kernel |
|---|---|
| Message-ID | <CAMuHMdV9PynJKN9=UX3+t1orWJiPusbsELPybLN_UVnykDH9Mw@mail.gmail.com> |
On Wed, Apr 19, 2023 at 1:55 PM John Paul Adrian Glaubitz <[email protected]> wrote: > 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.") > Signed-off-by: John Paul Adrian Glaubitz <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds