Bug 8005

Summary: a possible bug in "usb/gadget/inode.c"
Product: Drivers Reporter: Lingxiao Jiang (skyhover.pi)
Component: USBAssignee: Greg Kroah-Hartman (greg)
Status: REJECTED INSUFFICIENT_DATA    
Severity: normal CC: protasnb
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.20 Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 5089    

Description Lingxiao Jiang 2007-02-14 00:20:12 UTC
Most recent kernel where this bug did *NOT* occur: no

Problem Description: If take a look at the code at lines 399-428 and lines
443-473  in "drivers/usb/gadget/inode.c", one can see the two pieces of code are
similar, although one is for "read" and the other is for "write". However, the
two "if" conditions at line 399 and 443 are complementing each other; it seems
that one of them is doing a "wrong" direction.

Also, line 460 may use a "unlikely", just like line 416, for a little better
optimization. 

Suggested fix: negate the condition at line 443; add "unlikely" at line 460.

Thanks,
Comment 1 Natalie Protasevich 2008-02-14 22:51:35 UTC
Lingxiao, this is almost a policy to submit a patch when the code seems wrong, not to open a bugzilla :) Would you like to submit the patch to linux-usb@vger.kernel.org?