diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-03-08 21:35:48 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-03-09 04:07:51 +0700 |
commit | b42330516f0aa4bdbbef03ad98555498ec16a715 (patch) | |
tree | 74386a8e49e0f33878f347486c50c8c875bb1439 | |
parent | 68b1e8e99c9f5acea52ecf3c8c5aa562ef9ccaa6 (diff) |
src/msgb.c: print an error if msgb allocation failed
Printing an error message when msgb allocation failed was initially
intended, but have been commented out for years. This would
facilitate the bug hunting process, especially on embedded
platforms with limited resources (e.g. amount of RAM).
The GLOBAL logging subsystem with FATAL level is used
for printing such messages.
Change-Id: I3e2d1beabd6936fc28a1ad664c083ff1698bb644
-rw-r--r-- | src/msgb.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -62,6 +62,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/talloc.h> +#include <osmocom/core/logging.h> void *tall_msgb_ctx = NULL; @@ -81,7 +82,8 @@ struct msgb *msgb_alloc(uint16_t size, const char *name) msg = _talloc_zero(tall_msgb_ctx, sizeof(*msg) + size, name); if (!msg) { - //LOGP(DRSL, LOGL_FATAL, "unable to allocate msgb\n"); + LOGP(DLGLOBAL, LOGL_FATAL, "Unable to allocate a msgb: " + "name='%s', size=%u\n", name, size); return NULL; } |