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

Re: KernelNewbies Wikki



Sanjay Kumar, Noida a écrit :
Hi,
In the module registration function (loading) of the HelloDriverSource
http://wiki.kernelnewbies.org/wiki/HelloDriverSource
if the kmalloc fails for hello_msg, why do we need to release the semaphore.This is the code snippet:
if (!hello_msg){
up(&hello_sem);
return -ENOMEM;
}
Till this point, the semaphore has not even been initialized.
Am I missing something.

Hi, you're right : the up(&hello_sem) has nothong to do here. Thanks.


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/