if (device) { list_del(&device->dlist); goto found; }
static int stgt_device_destroy(int tid, uint32_t lun){	struct stgt_device *device;	struct stgt_target *target;	unsigned long flags;	target = target_find(tid);	if (!target)		return -ENOENT;	spin_lock_irqsave(&target->lock, flags);	device = stgt_device_find_nolock(target, lun);	if (device) {		list_del(&device->dlist);		goto found;	}	spin_unlock_irqrestore(&target->lock, flags);	return -EINVAL;found:	if (device->sdt->destroy)		device->sdt->destroy(device);	device_template_put(device->sdt);	stgt_sysfs_unregister_device(device);	return 0;}