Skip to content

Commit

Permalink
USB: fsl_usb2_udc: fix potential queue head corruption
Browse files Browse the repository at this point in the history
Clear next TD field and status field in queue head initialization code
to prevent unpredictable result caused by residue of usb reset.

Signed-off-by: Li Yang <leoli@freescale.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Li Yang authored and Greg Kroah-Hartman committed Feb 27, 2009
1 parent 64e7130 commit 9a6e184
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/gadget/fsl_usb2_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ static void struct_ep_qh_setup(struct fsl_udc *udc, unsigned char ep_num,
}
if (zlt)
tmp |= EP_QUEUE_HEAD_ZLT_SEL;

p_QH->max_pkt_length = cpu_to_le32(tmp);
p_QH->next_dtd_ptr = 1;
p_QH->size_ioc_int_sts = 0;

return;
}
Expand Down

0 comments on commit 9a6e184

Please sign in to comment.