Re: [PATCH 1/2] kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers

From: Brendan Higgins
Date: Thu Apr 22 2021 - 16:03:12 EST


On Wed, Apr 21, 2021 at 11:32 AM Daniel Latypov <dlatypov@xxxxxxxxxx> wrote:
>
> Add in:
> * kunit_kmalloc_array() and wire up kunit_kmalloc() to be a special
> case of it.
> * kunit_kcalloc() for symmetry with kunit_kzalloc()
>
> This should using KUnit more natural by making it more similar to the
> existing *alloc() APIs.
>
> And while we shouldn't necessarily be writing unit tests where overflow
> should be a concern, it can't hurt to be safe.
>
> Signed-off-by: Daniel Latypov <dlatypov@xxxxxxxxxx>

Aside from the copy and paste issue that David already pointed out, LGTM.

Reviewed-by: Brendan Higgins <brendanhiggins@xxxxxxxxxx>