Is it illegal to have kernel virtual address == 0 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I've seen some modules where it is tested if virtual address is 0, and
if yes, it is acted as if it is an error.
But can't virtual address be zero too ?

For example, in the following module:
https://github.com/khilman/omap-test-dmatest/blob/master/main.c
it is checked the returned value of dma_alloc_coherent as following:

dma_test[i].src_buf = (unsigned long) dma_alloc_coherent(NULL,
buf_size (dma_addr_t *)&dma_test[i].src_buf_phys, GFP_KERNEL |
GFP_DMA);
if (!dma_test[i].src_buf) {
   printk("dmatest_init(): get_zeroed_page() failed.\n");
   r = -ENOMEM;
   goto cleanup;
}

As you can see , when  dma_alloc_coherent returns 0 , it is acted as
if it is an error.

Thank you,
Ran

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux