X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fch.c;h=aa2011b6468387609993e2ab7643b8e40740c403;hb=25377479de7539fdc871a0f0ecaa39da42353bbc;hp=c4b938bc30d393f92eebaaf9c506009885f50176;hpb=28638ea4f8adb63f837e4436560ab16ab0388587;p=linux-2.6 diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index c4b938bc30..aa2011b646 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -22,6 +22,7 @@ #include /* here are all the ioctls */ #include #include +#include #include #include @@ -571,16 +572,19 @@ ch_open(struct inode *inode, struct file *file) scsi_changer *ch; int minor = iminor(inode); + lock_kernel(); spin_lock(&ch_index_lock); ch = idr_find(&ch_index_idr, minor); if (NULL == ch || scsi_device_get(ch->device)) { spin_unlock(&ch_index_lock); + unlock_kernel(); return -ENXIO; } spin_unlock(&ch_index_lock); file->private_data = ch; + unlock_kernel(); return 0; }