spin_lock_bh(&appldata_ops_lock); 
spin_lock(&appldata_ops_lock); 
appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,			   void __user *buffer, size_t *lenp, loff_t *ppos){	struct appldata_ops *ops = NULL, *tmp_ops;	int rc, len, found;	char buf[2];	struct list_head *lh;	found = 0;	spin_lock_bh(&appldata_ops_lock);	list_for_each(lh, &appldata_ops_list) {		tmp_ops = list_entry(lh, struct appldata_ops, list);		if (&tmp_ops->ctl_table[2] == ctl) {			found = 1;		}	}	if (!found) {		spin_unlock_bh(&appldata_ops_lock);		return -ENODEV;	}	ops = ctl->data;	if (!try_module_get(ops->owner)) {	// protect this function		spin_unlock_bh(&appldata_ops_lock);		return -ENODEV;	}	spin_unlock_bh(&appldata_ops_lock);	if (!*lenp || *ppos) {		*lenp = 0;		module_put(ops->owner);		return 0;	}	if (!write) {		len = sprintf(buf, ops->active ? "1\n" : "0\n");		if (len > *lenp)			len = *lenp;		if (copy_to_user(buffer, buf, len)) {			module_put(ops->owner);			return -EFAULT;		}		goto out;	}	len = *lenp;	if (copy_from_user(buf, buffer,			   len > sizeof(buf) ? sizeof(buf) : len)) {		module_put(ops->owner);		return -EFAULT;	}	spin_lock_bh(&appldata_ops_lock);	if ((buf[0] == '1') && (ops->active == 0)) {		if (!try_module_get(ops->owner)) {	// protect tasklet			spin_unlock_bh(&appldata_ops_lock);			module_put(ops->owner);			return -ENODEV;		}		ops->active = 1;		ops->callback(ops->data);	// init record		rc = appldata_diag(ops->record_nr,					APPLDATA_START_INTERVAL_REC,					(unsigned long) ops->data, ops->size);		if (rc != 0) {			P_ERROR("START DIAG 0xDC for %s failed, "				"return code: %d\n", ops->name, rc);			module_put(ops->owner);			ops->active = 0;		} else {			P_INFO("Monitoring %s data enabled, "				"DIAG 0xDC started.\n", ops->name);		}	} else if ((buf[0] == '0') && (ops->active == 1)) {		ops->active = 0;		rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,				(unsigned long) ops->data, ops->size);		if (rc != 0) {			P_ERROR("STOP DIAG 0xDC for %s failed, "				"return code: %d\n", ops->name, rc);		} else {			P_INFO("Monitoring %s data disabled, "				"DIAG 0xDC stopped.\n", ops->name);		}		module_put(ops->owner);	}	spin_unlock_bh(&appldata_ops_lock);out:	*lenp = len;	*ppos += len;	module_put(ops->owner);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f26d583e41aedad8159acf9533fa287d7209dfbf/appldata_base.c/buggy/arch/s390/appldata/appldata_base.c