Commit 0b9d8055 authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] don't dereference sdev->access_count in dpt_i2o

This is nothing a LLDD should ever look at and might go away
completly soon.  The uses are for a printk and a racy ioctl.
parent 9c1865a3
......@@ -1949,26 +1949,6 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
case I2ORESCANCMD:
adpt_rescan(pHba);
break;
case DPT_TARGET_BUSY & 0xFFFF:
case DPT_TARGET_BUSY:
{
TARGET_BUSY_T busy;
struct adpt_device* d;
if (copy_from_user((void*)&busy, (void*)arg, sizeof(TARGET_BUSY_T))) {
return -EFAULT;
}
d = adpt_find_device(pHba, busy.channel, busy.id, busy.lun);
if(d == NULL){
return -ENODEV;
}
busy.isBusy = ((d->pScsi_dev) && (0 != d->pScsi_dev->access_count)) ? 1 : 0;
if (copy_to_user ((char*)arg, &busy, sizeof(busy))) {
return -EFAULT;
}
break;
}
default:
return -EINVAL;
}
......@@ -2492,10 +2472,6 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
printk(KERN_WARNING"%s: Device (%d,%d,%d) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->scsi_lun);
if (pDev->pScsi_dev) {
pDev->pScsi_dev->online = FALSE;
if (pDev->pScsi_dev->access_count) {
// A drive that was mounted is no longer there... bad!
printk(KERN_WARNING"%s:Mounted drive taken offline\n",pHba->name);
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment