Browse Source

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>
Mauro Carvalho Chehab 7 years ago
parent
commit
ca33f8f61a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c

+ 1 - 1
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;