usblp: Make use of URB_FREE_BUFFER

Pete Zaitcev <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Red Hat, Inc.
Message-ID <[email protected]>
Employ the new API URB_FREE_BUFFER that we've got. There was talk of a combined
constructor for this case, but apparently it's not happening, so just set the
flag explicitly for now.

Signed-off-by: Pete Zaitcev <[email protected]>

--- linux-2.6.23-rc1-nip/drivers/usb/class/usblp.c	2007-07-22 22:22:38.000000000 -0700
+++ linux-2.6.22-mon/drivers/usb/class/usblp.c	2007-07-10 22:20:16.000000000 -0700
@@ -331,9 +330,6 @@ static void usblp_bulk_write(struct urb 
 	wake_up(&usblp->wwait);
 	spin_unlock(&usblp->lock);
 
-	/* XXX Use usb_setup_bulk_urb when available. Talk to Marcel. */
-	kfree(urb->transfer_buffer);
-	urb->transfer_buffer = NULL;	/* Not refcounted, so to be safe... */
 	usb_free_urb(urb);
 }
 
@@ -719,6 +716,7 @@ static ssize_t usblp_write(struct file *
 			usb_sndbulkpipe(usblp->dev,
 			  usblp->protocol[usblp->current_protocol].epwrite->bEndpointAddress),
 			writebuf, transfer_length, usblp_bulk_write, usblp);
+		writeurb->transfer_flags |= URB_FREE_BUFFER;
 		usb_anchor_urb(writeurb, &usblp->urbs);
 
 		if (copy_from_user(writebuf,

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.