if (serio->drv != &psmouse_drv) 
if (serio->drv != &psmouse_drv) { input_free_device(new_dev); 
static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, const char *buf, size_t count){	struct serio *serio = psmouse->ps2dev.serio;	struct psmouse *parent = NULL;	struct psmouse_protocol *proto;	int retry = 0;	if (!(proto = psmouse_protocol_by_name(buf, count)))		return -EINVAL;	if (psmouse->type == proto->type)		return count;	while (serio->child) {		if (++retry > 3) {			printk(KERN_WARNING "psmouse: failed to destroy child port, protocol change aborted.\n");			return -EIO;		}		up(&psmouse_sem);		serio_unpin_driver(serio);		serio_unregister_child_port(serio);		serio_pin_driver_uninterruptible(serio);		down(&psmouse_sem);		if (serio->drv != &psmouse_drv)			return -ENODEV;		if (psmouse->type == proto->type)			return count; /* switched by other thread */	}	if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {		parent = serio_get_drvdata(serio->parent);		if (parent->pt_deactivate)			parent->pt_deactivate(parent);	}	if (psmouse->disconnect)		psmouse->disconnect(psmouse);	psmouse_set_state(psmouse, PSMOUSE_IGNORE);	input_unregister_device(&psmouse->dev);	psmouse_set_state(psmouse, PSMOUSE_INITIALIZING);	if (psmouse_switch_protocol(psmouse, proto) < 0) {		psmouse_reset(psmouse);		/* default to PSMOUSE_PS2 */		psmouse_switch_protocol(psmouse, &psmouse_protocols[0]);	}	psmouse_initialize(psmouse);	psmouse_set_state(psmouse, PSMOUSE_CMD_MODE);	input_register_device(&psmouse->dev);	printk(KERN_INFO "input: %s on %s\n", psmouse->devname, serio->phys);	if (parent && parent->pt_activate)		parent->pt_activate(parent);	return count;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2e5b636bb5f8dacbb91d08544e2c41ebcad5dace/psmouse-base.c/buggy/drivers/input/mouse/psmouse-base.c