diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 4631953b9c96..33f6f8f99039 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -279,7 +279,7 @@ static int ion_assign_heap_id(struct ion_heap *heap, struct ion_device *dev) if (test_and_set_bit(id_bit - 1, dev->heap_ids)) return -EEXIST; - heap->id = id_bit; + heap->id = id_bit - 1; dev->heap_cnt++; return 0; @@ -392,7 +392,7 @@ void ion_device_remove_heap(struct ion_heap *heap) __func__, heap->name); } debugfs_remove_recursive(heap->debugfs_dir); - clear_bit(heap->id - 1, dev->heap_ids); + clear_bit(heap->id, dev->heap_ids); dev->heap_cnt--; up_write(&dev->lock); }