Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1a94f08 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman
Browse files

USB: g_file_storage: fix bug in DMA buffer handling



This patch (as963) fixes a recently-introduced bug.  The gadget
conversion removing DMA-mapped buffer allocation did not remove quite
enough code from the g_file_storage driver; DMA pointers were being
set to 0.

Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 013d27f2
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -599,7 +599,6 @@ enum fsg_buffer_state {


struct fsg_buffhd {
struct fsg_buffhd {
	void				*buf;
	void				*buf;
	dma_addr_t			dma;
	enum fsg_buffer_state		state;
	enum fsg_buffer_state		state;
	struct fsg_buffhd		*next;
	struct fsg_buffhd		*next;


@@ -2612,7 +2611,6 @@ static int send_status(struct fsg_dev *fsg)


		fsg->intr_buffhd = bh;		// Point to the right buffhd
		fsg->intr_buffhd = bh;		// Point to the right buffhd
		fsg->intreq->buf = bh->inreq->buf;
		fsg->intreq->buf = bh->inreq->buf;
		fsg->intreq->dma = bh->inreq->dma;
		fsg->intreq->context = bh;
		fsg->intreq->context = bh;
		start_transfer(fsg, fsg->intr_in, fsg->intreq,
		start_transfer(fsg, fsg->intr_in, fsg->intreq,
				&fsg->intreq_busy, &bh->state);
				&fsg->intreq_busy, &bh->state);
@@ -3201,7 +3199,6 @@ static int do_set_interface(struct fsg_dev *fsg, int altsetting)
		if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0)
		if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0)
			goto reset;
			goto reset;
		bh->inreq->buf = bh->outreq->buf = bh->buf;
		bh->inreq->buf = bh->outreq->buf = bh->buf;
		bh->inreq->dma = bh->outreq->dma = bh->dma;
		bh->inreq->context = bh->outreq->context = bh;
		bh->inreq->context = bh->outreq->context = bh;
		bh->inreq->complete = bulk_in_complete;
		bh->inreq->complete = bulk_in_complete;
		bh->outreq->complete = bulk_out_complete;
		bh->outreq->complete = bulk_out_complete;