Author: jh
Date: Thu Aug 19 16:39:00 2010
New Revision: 211513
URL: http://svn.freebsd.org/changeset/base/211513

Log:
  Call dev_rel() in error paths.
  
  Reported by:  kib
  Reviewed by:  kib
  MFC after:    2 weeks

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c     Thu Aug 19 16:38:58 2010        
(r211512)
+++ head/sys/fs/devfs/devfs_vnops.c     Thu Aug 19 16:39:00 2010        
(r211513)
@@ -848,6 +848,8 @@ devfs_lookupx(struct vop_lookup_args *ap
                        *dm_unlock = 0;
                        sx_xunlock(&dmp->dm_lock);
                        devfs_unmount_final(dmp);
+                       if (cdev != NULL)
+                               dev_rel(cdev);
                        return (ENOENT);
                }
                if (cdev == NULL)
@@ -859,6 +861,7 @@ devfs_lookupx(struct vop_lookup_args *ap
                        *dm_unlock = 0;
                        sx_xunlock(&dmp->dm_lock);
                        devfs_unmount_final(dmp);
+                       dev_rel(cdev);
                        return (ENOENT);
                }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to