On Thu, Apr 27, 2006 at 11:30:22AM +0530, Vishal Sharda wrote: > > > > -----Original Message----- > > From: Greg KH [mailto:greg@xxxxxxxxx] > > Sent: Wednesday, April 26, 2006 11:48 AM > > To: Vishal Sharda > > Cc: kernelnewbies@xxxxxxxxxxxx > > Subject: Re: function "class_device_add" in > inux26/drivers/base/class.c > > > > On Wed, Apr 26, 2006 at 11:23:39AM +0530, Vishal Sharda wrote: > > > > > > In the function "class_device_add" in inux26/drivers/base/class.c > > > There is one statement: > > > > > > parent = class_get(class_dev->class); > > > > > > My question is that can return value of class_get i.e. value of > parent > > > be NULL? > > > > > > I tried to track it down and couldn't find the instance where it can > be > > > NULL. > > > > If class_dev->class == NULL, then class_get() will also return NULL. > > > > Yes, that is also true. Okay, so now question is whether > class_dev->class > Can be NULL? And I repeat that "I tried to track it down and couldn't > find the instance where it can be NULL." > In what conditions it can be NULL? For example if a class_dev structure has been allocated and not initialized : the class_dev->class will be NULL. -- tyler tyler@xxxxxxxx ___________________________________________________________________________ Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement vos services préférés : vérifiez vos nouveaux mails, lancez vos recherches et suivez l'actualité en temps réel. Rendez-vous sur http://fr.yahoo.com/set -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/