if (tpnt->buffer) { tpnt->buffer->orig_frp_segs = 0; normalize_buffer(tpnt->buffer); kfree(tpnt->buffer); } put_disk(tpnt->disk); kfree(tpnt); 
down(&st_ref_sem); kref_put(&tpnt->kref, scsi_tape_release); up(&st_ref_sem); 
static int st_remove(struct device *dev){	struct scsi_device *SDp = to_scsi_device(dev);	struct scsi_tape *tpnt;	int i, j, mode;	write_lock(&st_dev_arr_lock);	for (i = 0; i < st_dev_max; i++) {		tpnt = scsi_tapes[i];		if (tpnt != NULL && tpnt->device == SDp) {			scsi_tapes[i] = NULL;			st_nr_dev--;			write_unlock(&st_dev_arr_lock);			devfs_unregister_tape(tpnt->disk->number);			sysfs_remove_link(&tpnt->device->sdev_gendev.kobj,					  "tape");			for (mode = 0; mode < ST_NBR_MODES; ++mode) {				j = mode << (4 - ST_NBR_MODE_BITS);				devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]);				devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]);				for (j=0; j < 2; j++) {					class_device_destroy(st_sysfs_class,							     MKDEV(SCSI_TAPE_MAJOR,								   TAPE_MINOR(i, mode, j)));					cdev_del(tpnt->modes[mode].cdevs[j]);					tpnt->modes[mode].cdevs[j] = NULL;				}			}			tpnt->device = NULL;			if (tpnt->buffer) {				tpnt->buffer->orig_frp_segs = 0;				normalize_buffer(tpnt->buffer);				kfree(tpnt->buffer);			}			put_disk(tpnt->disk);			kfree(tpnt);			return 0;		}	}	write_unlock(&st_dev_arr_lock);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f03a567054fea4f9d43c50ec91338266c0bd588d/st.c/clean/drivers/scsi/st.c