Re: Can mm_struct of a process be null?

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

 



On Fri, Nov 15, 2013 at 6:24 PM, Paul Davies C <pauldaviesc@xxxxxxxxx> wrote:
> Hi,
>     I happen to find this code snippet in the kernel source :
>
>     struct mm_struct *mm=current->mm;
>
>     /* some other code */
>
>     if(mm){ /*<==Why is this here? */
>         /*read the contents by locking*/
>     }
>
> The if  checks whether the mm_struct of the current process is NULL or not.
> That means the mm_struct of a process can become NULL. How can that happen?

mm_struct points to a process address space. It is NULL for kernel threads.

Daniel.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://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