[qca-nss-drv] Corrected message length checks for H2N messages
The message length validation checks for H2N and N2H messages is corrected.
Change-Id: I150131234a4c858fea9ed8da84f848faf9ff385c
Signed-off-by: Suruchi Agarwal <suruchia@codeaurora.org>
diff --git a/nss_oam.c b/nss_oam.c
index 7d680ff..2957d5d 100644
--- a/nss_oam.c
+++ b/nss_oam.c
@@ -38,8 +38,8 @@
/*
* Sanity check the message type
*/
- if (ncm->len > sizeof(struct nss_oam_msg)) {
- nss_warning("%p: recevied with invalid msg size: %d", nss_ctx, ncm->len);
+ if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_oam_msg)) {
+ nss_warning("%p: recevied with invalid msg size: %d", nss_ctx, nss_cmn_get_msg_len(ncm));
return;
}
@@ -93,8 +93,8 @@
return NSS_TX_FAILURE;
}
- if (ncm->len > msg_sz) {
- nss_warning("%p: tx request with invalid size: %d", nss_ctx, ncm->len);
+ if (nss_cmn_get_msg_len(ncm) > msg_sz) {
+ nss_warning("%p: tx request with invalid size: %d", nss_ctx, nss_cmn_get_msg_len(ncm));
return NSS_TX_FAILURE_TOO_SHORT;
}