]> git.baikalelectronics.ru Git - kernel.git/commit
devres: handle zero size in devm_kmalloc()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 29 Jun 2020 06:50:06 +0000 (08:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jul 2020 12:36:02 +0000 (14:36 +0200)
commitcad064f1bd5237481d15b72b481809e3f0907dd9
treea86ec4ec838e7efb4a6a671586db5e2e458e9235
parent67dd0772396905a108c37202d4a5949ab69131a0
devres: handle zero size in devm_kmalloc()

Make devm_kmalloc() behave similarly to non-managed kmalloc(): return
ZERO_SIZE_PTR when requested size is 0. Update devm_kfree() to handle
this case.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20200629065008.27620-5-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/devres.c