Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a30427d9 authored by Jonathan Corbet's avatar Jonathan Corbet
Browse files

Add a comment in chrdev_open()



I stared at this code for a while and almost deleted it before
understanding crept into my slow brain.  Hopefully this makes life easier
for the next person to happen on it.

Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent f2b9857e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -373,6 +373,8 @@ static int chrdev_open(struct inode *inode, struct file *filp)
			return -ENXIO;
		new = container_of(kobj, struct cdev, kobj);
		spin_lock(&cdev_lock);
		/* Check i_cdev again in case somebody beat us to it while
		   we dropped the lock. */
		p = inode->i_cdev;
		if (!p) {
			inode->i_cdev = p = new;