struct firmware_priv *fw_priv = kmalloc(sizeof (struct firmware_priv), 
struct firmware_priv *fw_priv = kzalloc(sizeof(*fw_priv), 
fw_register_class_device(struct class_device **class_dev_p,			 const char *fw_name, struct device *device){	int retval;	struct firmware_priv *fw_priv = kmalloc(sizeof (struct firmware_priv),						GFP_KERNEL);	struct class_device *class_dev = kmalloc(sizeof (struct class_device),						 GFP_KERNEL);	*class_dev_p = NULL;	if (!fw_priv || !class_dev) {		printk(KERN_ERR "%s: kmalloc failed\n", __FUNCTION__);		retval = -ENOMEM;		goto error_kfree;	}	memset(fw_priv, 0, sizeof (*fw_priv));	memset(class_dev, 0, sizeof (*class_dev));	init_completion(&fw_priv->completion);	fw_priv->attr_data = firmware_attr_data_tmpl;	strlcpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX);	fw_priv->timeout.function = firmware_class_timeout;	fw_priv->timeout.data = (u_long) fw_priv;	init_timer(&fw_priv->timeout);	fw_setup_class_device_id(class_dev, device);	class_dev->dev = device;	class_dev->class = &firmware_class;	class_set_devdata(class_dev, fw_priv);	retval = class_device_register(class_dev);	if (retval) {		printk(KERN_ERR "%s: class_device_register failed\n",		       __FUNCTION__);		goto error_kfree;	}	*class_dev_p = class_dev;	return 0;error_kfree:	kfree(fw_priv);	kfree(class_dev);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4aed0644d684428e811bb6944f032b460a3ab165/firmware_class.c/clean/drivers/base/firmware_class.c