Skip to content

Commit

Permalink
USB: gadget rndis: send notifications
Browse files Browse the repository at this point in the history
It turns out that atomic_inc_return() returns the *new* value
not the original one, so the logic in rndis_response_available()
kept the first RNDIS response notification from getting out.
This prevented interoperation with MS-Windows (but not Linux).

Fix this to make RNDIS behave again.

Signed-off-by: Richard Röjfors <richard.rojfors@endian.se>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Richard Röjfors authored and Greg Kroah-Hartman committed Nov 20, 2008
1 parent 9c26452 commit ff34950
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void rndis_response_available(void *_rndis)
__le32 *data = req->buf;
int status;

if (atomic_inc_return(&rndis->notify_count))
if (atomic_inc_return(&rndis->notify_count) != 1)
return;

/* Send RNDIS RESPONSE_AVAILABLE notification; a
Expand Down

0 comments on commit ff34950

Please sign in to comment.