msm: ipa3: adding check for holb stats
Adding null checks while getting the holb stats Change-Id: Iba83cd86522679137f66fa1e7844884955fecf4d Signed-off-by: Veerendra Kumar Kamsali <quic_veekum@quicinc.com>
このコミットが含まれているのは:

committed by
Gerrit - the friendly Code Review server

コミット
e739dfa5ab
@@ -229,6 +229,7 @@ static int ipa_get_generic_stats(unsigned long arg)
|
||||
return res;
|
||||
}
|
||||
|
||||
if(ipa_lnx_agent_ctx.alloc_info.num_holb_drop_stats_clients != 0 ) {
|
||||
/* HOLB Discard stats */
|
||||
holb_disc_stats_ptr = &generic_stats->holb_stats.holb_disc_stats[0];
|
||||
for (i = 0; i < IPA_CLIENT_MAX; i++) {
|
||||
@@ -250,7 +251,9 @@ static int ipa_get_generic_stats(unsigned long arg)
|
||||
holb_disc_stats_ptr = (struct holb_discard_stats *)((
|
||||
uint64_t)holb_disc_stats_ptr + sizeof(struct holb_discard_stats));
|
||||
}
|
||||
}
|
||||
|
||||
if(ipa_lnx_agent_ctx.alloc_info.num_holb_mon_stats_clients != 0 ) {
|
||||
/* HOLB Monitor stats */
|
||||
holb_mon_stats_ptr = (struct holb_monitor_stats *)(
|
||||
(uint64_t)&generic_stats->holb_stats.holb_disc_stats[0] +
|
||||
@@ -271,6 +274,7 @@ static int ipa_get_generic_stats(unsigned long arg)
|
||||
holb_mon_stats_ptr = (struct holb_monitor_stats *)((
|
||||
uint64_t)holb_mon_stats_ptr + sizeof(struct holb_monitor_stats));
|
||||
}
|
||||
}
|
||||
|
||||
if(copy_to_user((void __user *)arg,
|
||||
(u8 *)generic_stats,
|
||||
|
新しいイシューから参照
ユーザーをブロックする