2001-11-29 00:37:45

by Anton Altaparmakov

[permalink] [raw]
Subject: [PATCH] 2.5.1-pre3 fix error in drivers/block/rd.c

Linus,

I think someone made a very silly mistake which this patchlet fixes.
Taking a spinlock and returning from a function before releasing it...

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

--- linux-2.5.1-pre3-vanilla/drivers/block/rd.c.old Thu Nov 29 00:34:17 2001
+++ linux-2.5.1-pre3-vanilla/drivers/block/rd.c Thu Nov 29 00:35:03 2001
@@ -437,9 +437,9 @@

#ifdef CONFIG_BLK_DEV_INITRD
if (unit == INITRD_MINOR) {
+ if (!initrd_start) return -ENODEV;
spin_lock( &initrd_users_lock );
initrd_users++;
- if (!initrd_start) return -ENODEV;
spin_unlock( &initrd_users_lock );
filp->f_op = &initrd_fops;
return 0;