X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=drivers%2Ftarget%2Ftarget_core_user.c;h=c3adefe95e50f7f7054e272e15fc5e37663d11c9;hb=cf393195c3ba5d4c0a8e237eb00f7ef104876ee5;hp=8041710b697298ec7073c4e5910849bd1a154703;hpb=9763dd6f8160dc9cc239fc2427c8173073204457;p=karo-tx-linux.git diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 8041710b6972..c3adefe95e50 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -642,9 +642,7 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) WARN_ON(tcmu_hdr_get_op(entry->hdr.len_op) != TCMU_OP_CMD); spin_lock(&udev->commands_lock); - cmd = idr_find(&udev->commands, entry->hdr.cmd_id); - if (cmd) - idr_remove(&udev->commands, cmd->cmd_id); + cmd = idr_remove(&udev->commands, entry->hdr.cmd_id); spin_unlock(&udev->commands_lock); if (!cmd) { @@ -783,15 +781,15 @@ static int tcmu_find_mem_index(struct vm_area_struct *vma) return -1; } -static int tcmu_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +static int tcmu_vma_fault(struct vm_fault *vmf) { - struct tcmu_dev *udev = vma->vm_private_data; + struct tcmu_dev *udev = vmf->vma->vm_private_data; struct uio_info *info = &udev->uio_info; struct page *page; unsigned long offset; void *addr; - int mi = tcmu_find_mem_index(vma); + int mi = tcmu_find_mem_index(vmf->vma); if (mi < 0) return VM_FAULT_SIGBUS;