diff options
author | Ahmed Mansour <Ahmed.Mansour@freescale.com> | 2014-11-27 22:32:29 (GMT) |
---|---|---|
committer | Honghua Yin <Hong-Hua.Yin@freescale.com> | 2015-03-26 07:42:26 (GMT) |
commit | 768c72f914a2aa2989467426731aa3a9dfd2e87c (patch) | |
tree | 498dd5422fb122b673ae66a6507829f1b472d114 /drivers/staging/fsl_qbman/bman_high.c | |
parent | 5deea3e04e4643bdff2c885c35f9cce57c6cf476 (diff) | |
download | linux-fsl-qoriq-768c72f914a2aa2989467426731aa3a9dfd2e87c.tar.xz |
qbman: Add Exception handling - static analysis
Catch exceptions and return from functions safely in qbman. Exception handling
holes were found in static analysis review
Signed-off-by: Ahmed Mansour <Ahmed.Mansour@freescale.com>
Change-Id: Ie1e2feadffd2c5c968164d0c569af147ab7929fb
Reviewed-on: http://git.am.freescale.net:8181/25568
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'drivers/staging/fsl_qbman/bman_high.c')
-rw-r--r-- | drivers/staging/fsl_qbman/bman_high.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/fsl_qbman/bman_high.c b/drivers/staging/fsl_qbman/bman_high.c index cc25de4..963e9d6 100644 --- a/drivers/staging/fsl_qbman/bman_high.c +++ b/drivers/staging/fsl_qbman/bman_high.c @@ -820,6 +820,8 @@ static noinline struct bm_rcr_entry *wait_rel_start(struct bman_portal **p, pool = NULL; #endif if (flags & BMAN_RELEASE_FLAG_WAIT_INT) + /* NB: return NULL if signal occurs before completion. Signal + * can occur during return. Caller must check for signal */ wait_event_interruptible(affine_queue, (rcr = __wait_rel_start(p, pool, irqflags, flags))); else @@ -883,6 +885,8 @@ static inline int __bman_release(struct bman_pool *pool, if (unlikely((flags & BMAN_RELEASE_FLAG_WAIT) && (flags & BMAN_RELEASE_FLAG_WAIT_SYNC))) { if (flags & BMAN_RELEASE_FLAG_WAIT_INT) + /* NB: return success even if signal occurs before + * condition is true. pvb_commit guarantees success */ wait_event_interruptible(affine_queue, (p->rcri_owned != pool)); else |