media: atomisp: get rid of a warning
[sfrench/cifs-2.6.git] / drivers / staging / media / atomisp / pci / atomisp2 / hmm / hmm_bo.c
index c888f9c809f9441f3ea566f623b4aeb15a4c972d..a6620d2c9f507cf71d03cbf6a4480d3dab28b7a3 100644 (file)
@@ -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;