mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
gsi: Fix NULL pointer dereference on event-less channels
If gsi_start_channel() or gsi_stop_channel() are called on a channel with no event ring allocated, there will be null pointer dereference error. Adding null pointer check. Change-Id: I200aa09f49c2394041f66c33c458f7daa9aeaf8c Signed-off-by: Ilia Lin <ilial@codeaurora.org>
This commit is contained in:
parent
8ca7410b47
commit
554a879753
1 changed files with 4 additions and 2 deletions
|
|
@ -2991,7 +2991,8 @@ int gsi_start_channel(unsigned long chan_hdl)
|
|||
/* check if INTSET is in IRQ mode for GPI channel */
|
||||
val = gsi_readl(gsi_ctx->base +
|
||||
GSI_EE_n_CNTXT_INTSET_OFFS(gsi_ctx->per.ee));
|
||||
if (ctx->evtr->props.intf == GSI_EVT_CHTYPE_GPI_EV &&
|
||||
if (ctx->evtr &&
|
||||
ctx->evtr->props.intf == GSI_EVT_CHTYPE_GPI_EV &&
|
||||
val != GSI_INTR_IRQ) {
|
||||
GSIERR("GSI_EE_n_CNTXT_INTSET_OFFS %d\n", val);
|
||||
BUG();
|
||||
|
|
@ -3074,7 +3075,8 @@ int gsi_stop_channel(unsigned long chan_hdl)
|
|||
/* check if INTSET is in IRQ mode for GPI channel */
|
||||
val = gsi_readl(gsi_ctx->base +
|
||||
GSI_EE_n_CNTXT_INTSET_OFFS(gsi_ctx->per.ee));
|
||||
if (ctx->evtr->props.intf == GSI_EVT_CHTYPE_GPI_EV &&
|
||||
if (ctx->evtr &&
|
||||
ctx->evtr->props.intf == GSI_EVT_CHTYPE_GPI_EV &&
|
||||
val != GSI_INTR_IRQ) {
|
||||
GSIERR("GSI_EE_n_CNTXT_INTSET_OFFS %d\n", val);
|
||||
BUG();
|
||||
|
|
|
|||
Loading…
Reference in a new issue