net: pkt: Print size of the failed net_buf allocation

This information is useful when debugging things.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-03-06 17:14:08 +02:00
commit 9325109cbc

View file

@ -1151,9 +1151,10 @@ int net_pkt_alloc_buffer(struct net_pkt *pkt,
if (!buf) {
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
NET_ERR("Data buffer allocation failed (%s:%d)", caller, line);
NET_ERR("Data buffer (%zd) allocation failed (%s:%d)",
alloc_len, caller, line);
#else
NET_ERR("Data buffer allocation failed.");
NET_ERR("Data buffer (%zd) allocation failed.", alloc_len);
#endif
return -ENOMEM;
}