diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-04-05 18:47:23 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-04-05 18:47:22 -0700 |
| commit | 08acb0dfc30077280c625fdd649334e6a95388cf (patch) | |
| tree | 7aacbbd1b710edd86f7f11397e5a15d1bb658daa | |
| parent | fa6082745d00c802c0ca8870dae4d7b0a3c2222b (diff) | |
| parent | 5b2f7c5ec7a08225252ed28bd67572bea5182194 (diff) | |
Merge "msm: ipa2: Fix IPA kernel NULL pointer dereference"
| -rw-r--r-- | drivers/platform/msm/gsi/gsi.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/platform/msm/gsi/gsi.c b/drivers/platform/msm/gsi/gsi.c index 2ae2438032b7..20351dd8a492 100644 --- a/drivers/platform/msm/gsi/gsi.c +++ b/drivers/platform/msm/gsi/gsi.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1082,13 +1082,14 @@ int gsi_alloc_evt_ring(struct gsi_evt_ring_props *props, unsigned long dev_hdl, uint32_t val; struct gsi_evt_ctx *ctx; int res; - int ee = gsi_ctx->per.ee; + int ee; unsigned long flags; if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return -GSI_STATUS_NODEV; } + ee = gsi_ctx->per.ee; if (!props || !evt_ring_hdl || dev_hdl != (uintptr_t)gsi_ctx) { GSIERR("bad params props=%p dev_hdl=0x%lx evt_ring_hdl=%p\n", @@ -1605,7 +1606,7 @@ int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl, struct gsi_chan_ctx *ctx; uint32_t val; int res; - int ee = gsi_ctx->per.ee; + int ee; enum gsi_ch_cmd_opcode op = GSI_CH_ALLOCATE; uint8_t erindex; void **user_data; @@ -1614,6 +1615,7 @@ int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl, pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return -GSI_STATUS_NODEV; } + ee = gsi_ctx->per.ee; if (!props || !chan_hdl || dev_hdl != (uintptr_t)gsi_ctx) { GSIERR("bad params props=%p dev_hdl=0x%lx chan_hdl=%p\n", @@ -2208,12 +2210,13 @@ int gsi_query_channel_info(unsigned long chan_hdl, unsigned long flags; uint64_t rp; uint64_t wp; - int ee = gsi_ctx->per.ee; + int ee; if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return -GSI_STATUS_NODEV; } + ee = gsi_ctx->per.ee; if (chan_hdl >= gsi_ctx->max_ch || !info) { GSIERR("bad params chan_hdl=%lu info=%p\n", chan_hdl, info); @@ -2278,12 +2281,13 @@ int gsi_is_channel_empty(unsigned long chan_hdl, bool *is_empty) unsigned long flags; uint64_t rp; uint64_t wp; - int ee = gsi_ctx->per.ee; + int ee; if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return -GSI_STATUS_NODEV; } + ee = gsi_ctx->per.ee; if (chan_hdl >= gsi_ctx->max_ch || !is_empty) { GSIERR("bad params chan_hdl=%lu is_empty=%p\n", @@ -2464,13 +2468,14 @@ int gsi_poll_channel(unsigned long chan_hdl, { struct gsi_chan_ctx *ctx; uint64_t rp; - int ee = gsi_ctx->per.ee; + int ee; unsigned long flags; if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return -GSI_STATUS_NODEV; } + ee = gsi_ctx->per.ee; if (chan_hdl >= gsi_ctx->max_ch || !notify) { GSIERR("bad params chan_hdl=%lu notify=%p\n", chan_hdl, notify); |
