qcacmn: Handle error case with HAL SRNG setup

If hal_srng_setup() fails, memory allocated for srng
is not freed resulting in a leak. Free the memory in
that case. In future, return error to caller and
assert when invalid ring ID is used during setup.

Change-Id: I6f3a7494a5c5e861652f3a38d18c220cd9a6eef2
Cette révision appartient à :
Manoj Ekbote
2017-12-19 10:44:41 -08:00
révisé par snandini
Parent 7a41e8c20e
révision 376116e052
2 fichiers modifiés avec 9 ajouts et 0 suppressions

Voir le fichier

@@ -545,6 +545,7 @@ static int hal_get_srng_ring_id(struct hal_soc *hal, int ring_type,
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"%s: ring_num exceeded maximum no. of supported rings\n",
__func__);
/* TODO: This is a programming error. Assert if this happens */
return -EINVAL;
}