mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
devres: provide devm_krealloc()
Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200824173859.4910-2-brgl@bgdev.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
81b142245b
commit
f82485722e
@@ -206,6 +206,8 @@ int devres_release_group(struct device *dev, void *id);
|
||||
|
||||
/* managed devm_k.alloc/kfree for device drivers */
|
||||
void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp) __malloc;
|
||||
void *devm_krealloc(struct device *dev, void *ptr, size_t size,
|
||||
gfp_t gfp) __must_check;
|
||||
__printf(3, 0) char *devm_kvasprintf(struct device *dev, gfp_t gfp,
|
||||
const char *fmt, va_list ap) __malloc;
|
||||
__printf(3, 4) char *devm_kasprintf(struct device *dev, gfp_t gfp,
|
||||
|
||||
Reference in New Issue
Block a user