qcacmn: Rate limit error logs from send_diag_netlink_data

Introduce proper logging APIs for diag module and also rate limit error
logs when skb allocation fails in low memory conditions to avoid excessive
logging side effects

Change-Id: Ia41ff7cfd526180825df61a43f1f59163947f257
CRs-Fixed: 2836681
This commit is contained in:
Alan Chen
2020-12-11 12:39:18 -08:00
committed by snandini
parent 2eea47c0c9
commit 8a27ffb4ad
4 changed files with 13 additions and 2 deletions

View File

@@ -1750,8 +1750,7 @@ send_diag_netlink_data(const uint8_t *buffer, uint32_t len, uint32_t cmd)
skb_out = nlmsg_new(slot_len, GFP_ATOMIC);
if (!skb_out) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("Failed to allocate new skb\n"));
diag_err_rl("Failed to allocate new skb");
return A_ERROR;
}