mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
qcacmn: Harden NAPI event handler
Make sure that NAPI event handler would handle events only after it has been initialized. Check init flag before procesing the event and emit a warning and return an error to the caller. Change-Id: I9d2b84560ee2363ecf2a570dbef0275dfb87786a CRs-Fixed: 1091678
This commit is contained in:
parent
93e24e385d
commit
0f521bf9be
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
|
|
@ -468,6 +468,11 @@ int hif_napi_event(struct hif_opaque_softc *hif_ctx, enum qca_napi_event event,
|
|||
|
||||
NAPI_DEBUG("%s: -->(event=%d, aux=%p)", __func__, event, data);
|
||||
|
||||
if ((napid->state & HIF_NAPI_INITED) == 0) {
|
||||
NAPI_DEBUG("%s: got event when NAPI not initialized",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
spin_lock_bh(&(napid->lock));
|
||||
prev_state = napid->state;
|
||||
switch (event) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue