summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl_pme2/pme2_high.c
diff options
context:
space:
mode:
authorMahammad Ismayilzada <mahammad.ismayilzada@freescale.com>2015-06-23 22:12:23 (GMT)
committerHaiying Wang <Haiying.wang@freescale.com>2015-11-02 19:58:17 (GMT)
commit56e16e2ba7582bd85d462e6102ff5828a6c3282b (patch)
treea0042c5beb239163957a0abc7f47d10694c0367a /drivers/staging/fsl_pme2/pme2_high.c
parent3ac31aa3d0c611fbbcc07dcac7da7574f9b692bc (diff)
downloadlinux-fsl-qoriq-56e16e2ba7582bd85d462e6102ff5828a6c3282b.tar.xz
fsl-pme: Check for null pointers
Check for null pointers to prevent null pointer dereferencing Signed-off-by: Mahammad Ismayilzada <mahammad.ismayilzada@freescale.com> Change-Id: Icc267f51d5ad85187c6ee5d03aa87f8649e124c9
Diffstat (limited to 'drivers/staging/fsl_pme2/pme2_high.c')
-rw-r--r--drivers/staging/fsl_pme2/pme2_high.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/fsl_pme2/pme2_high.c b/drivers/staging/fsl_pme2/pme2_high.c
index 12ab7a1..e39bfc6 100644
--- a/drivers/staging/fsl_pme2/pme2_high.c
+++ b/drivers/staging/fsl_pme2/pme2_high.c
@@ -933,6 +933,7 @@ static inline void cb_helper(__always_unused struct qman_portal *portal,
if (error)
do_flags(ctx, 0, 0, PME_CTX_FLAG_DEAD, 0);
token = pop_matching_token(ctx, fd);
+ BUG_ON(!token);
if (likely(token->cmd_type == pme_cmd_scan)) {
ctx->cb(ctx, fd, token);
} else if (token->cmd_type == pme_cmd_pmtcc) {
@@ -1002,6 +1003,7 @@ static void cb_ern(__always_unused struct qman_portal *portal,
ctx = data->parent;
token = pop_matching_token(ctx, &mr->ern.fd);
+ BUG_ON(!token);
if (likely(token->cmd_type == pme_cmd_scan)) {
BUG_ON(!ctx->ern_cb);
ctx->ern_cb(ctx, mr, token);