Message ID | 20241125104011.36552-4-cgoettsche@seltendoof.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [01/11] coccinelle: Add script to reorder capable() calls | expand |
diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 4441aca2280a..77b2d191d21c 100644 --- a/drivers/misc/genwqe/card_dev.c +++ b/drivers/misc/genwqe/card_dev.c @@ -461,7 +461,7 @@ static int genwqe_mmap(struct file *filp, struct vm_area_struct *vma) goto free_dma_map; } - if (capable(CAP_SYS_ADMIN) && (vsize > sizeof(dma_addr_t))) + if ((vsize > sizeof(dma_addr_t)) && capable(CAP_SYS_ADMIN)) *(dma_addr_t *)dma_map->k_vaddr = dma_map->dma_addr; pfn = virt_to_phys(dma_map->k_vaddr) >> PAGE_SHIFT;