if (buf) kfree(buf); 
kfree(buf); 
int zd1201_fw_upload(struct usb_device *dev, int apfw){	const struct firmware *fw_entry;	char* data;	unsigned long len;	int err;	unsigned char ret;	char *buf;	char *fwfile;	if (apfw)		fwfile = "zd1201-ap.fw";	else		fwfile = "zd1201.fw";	err = request_firmware(&fw_entry, fwfile, &dev->dev);	if (err) {		dev_err(&dev->dev, "Failed to load %s firmware file!\n", fwfile);		dev_err(&dev->dev, "Make sure the hotplug firmware loader is installed.\n");		dev_err(&dev->dev, "Goto http://linux-lc100020.sourceforge.net for more info\n");		return err;	}	data = fw_entry->data;        len = fw_entry->size;	buf = kmalloc(1024, GFP_ATOMIC);	if (!buf)		goto exit;		while (len > 0) {		int translen = (len > 1024) ? 1024 : len;		memcpy(buf, data, translen);		err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 0,		    USB_DIR_OUT | 0x40, 0, 0, buf, translen,		    ZD1201_FW_TIMEOUT);		if (err < 0)			goto exit;		len -= translen;		data += translen;	}                                        	err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 0x2,	    USB_DIR_OUT | 0x40, 0, 0, NULL, 0, ZD1201_FW_TIMEOUT);	if (err < 0)		goto exit;                                                                                                                                                                	err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4,	    USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT);	if (err < 0)		goto exit;                                                                                                                                                                                                                                                                                        	if (ret & 0x80) {		err = -EIO;		goto exit;	}	err = 0;exit: 	if (buf)		kfree(buf);	release_firmware(fw_entry);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f/zd1201.c/buggy/drivers/usb/net/zd1201.c