David Somayajulu wrote:
- Your recently added scsi_host_put() was very wrong. You never
had a corresponding get().
Oops. The version I was looking at for cross reference had a get() in
scsi_host_lookup() and no corresponding put(). Looks like
scsi_host_lookup() has changed at some point. (I think Mike Christie was
under the same impression when he suggested this).
I think you guys are missing the get() from class_find_device or what
versions are you guys looking at? I have this from scsi-misc from today:
cdev = class_find_device(&shost_class, &hostnum,
__scsi_host_match);
if (cdev) {
shost = scsi_host_get(class_to_shost(cdev));
put_device(cdev);
}
If class_find_device finds a device class_find_device does a get on it. +1
If class_find_device found a device (cdev is non null)
scsi_host_lookup() does another get() on it if the host is not being
deleted. +1 (total =2)
scsi_host_lookup will then release the get() done from
class_find_device. -1 (total =1)
So if scsi_host_lookup returns with a host there will be a reference on
the host that must be released when we are done with it.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html