mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 16:16:15 -04:00
dfc: fix null pointer access
Fix a null pointer dereference issue when data packets trigger the queuing of powersave work before the powersave workqueue is initialized. Change-Id: Ia3515a7aaa47cb41568c39462bca73ceae11ea9c Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
parent
b7cf580e81
commit
aeca58ead5
1 changed files with 4 additions and 1 deletions
|
|
@ -919,6 +919,7 @@ EXPORT_SYMBOL(qmi_rmnet_qos_exit_post);
|
|||
static struct workqueue_struct *rmnet_ps_wq;
|
||||
static struct rmnet_powersave_work *rmnet_work;
|
||||
static bool rmnet_work_quit;
|
||||
static bool rmnet_work_inited;
|
||||
static LIST_HEAD(ps_list);
|
||||
|
||||
struct rmnet_powersave_work {
|
||||
|
|
@ -1148,6 +1149,7 @@ void qmi_rmnet_work_init(void *port)
|
|||
rmnet_work_quit = false;
|
||||
qmi_rmnet_work_set_active(rmnet_work->port, 1);
|
||||
queue_delayed_work(rmnet_ps_wq, &rmnet_work->work, PS_INTERVAL);
|
||||
rmnet_work_inited = true;
|
||||
}
|
||||
EXPORT_SYMBOL(qmi_rmnet_work_init);
|
||||
|
||||
|
|
@ -1156,7 +1158,7 @@ void qmi_rmnet_work_maybe_restart(void *port)
|
|||
struct qmi_info *qmi;
|
||||
|
||||
qmi = (struct qmi_info *)rmnet_get_qmi_pt(port);
|
||||
if (unlikely(!qmi))
|
||||
if (unlikely(!qmi || !rmnet_work_inited))
|
||||
return;
|
||||
|
||||
if (!test_and_set_bit(PS_WORK_ACTIVE_BIT, &qmi->ps_work_active))
|
||||
|
|
@ -1172,6 +1174,7 @@ void qmi_rmnet_work_exit(void *port)
|
|||
rmnet_work_quit = true;
|
||||
synchronize_rcu();
|
||||
|
||||
rmnet_work_inited = false;
|
||||
alarm_cancel(&rmnet_work->atimer);
|
||||
cancel_delayed_work_sync(&rmnet_work->work);
|
||||
destroy_workqueue(rmnet_ps_wq);
|
||||
|
|
|
|||
Loading…
Reference in a new issue