summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMauro Carvalho Chehab2018-04-12 11:44:33 +0200
committerMauro Carvalho Chehab2018-04-17 11:50:04 +0200
commitca33f8f61a6e4376cc006b713a353e7200e66f59 (patch)
treea5555ff9929a851dd7fbcc75ee17b170e2b71645 /drivers/staging
parentmedia: atomisp: compat32: fix __user annotations (diff)
downloadkernel-qcow2-linux-ca33f8f61a6e4376cc006b713a353e7200e66f59.tar.gz
kernel-qcow2-linux-ca33f8f61a6e4376cc006b713a353e7200e66f59.tar.xz
kernel-qcow2-linux-ca33f8f61a6e4376cc006b713a353e7200e66f59.zip
media: atomisp: get rid of a warning
On smatch, this warning is trigged: drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c:324 __bo_take_off_handling() error: we previously assumed 'bo->prev' could be null (see line 314) Because it can't properly analize the truth table for the above function. So, add an explicit check for the final condition there. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
index c888f9c809f9..a6620d2c9f50 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
@@ -319,7 +319,7 @@ static void __bo_take_off_handling(struct hmm_buffer_object *bo)
* to take off this bo, we just set take the "prev/next" pointers
* to NULL, the free rbtree stays unchaged
*/
- } else {
+ } else if (bo->prev != NULL && bo->next != NULL) {
bo->next->prev = bo->prev;
bo->prev->next = bo->next;
bo->next = NULL;