Skip to content

Commit ff34950

Browse files
Richard RöjforsGreg Kroah-Hartman
authored andcommitted
USB: gadget rndis: send notifications
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 <[email protected]> Signed-off-by: David Brownell <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9c26452 commit ff34950

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/gadget/f_rndis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static void rndis_response_available(void *_rndis)
302302
__le32 *data = req->buf;
303303
int status;
304304

305-
if (atomic_inc_return(&rndis->notify_count))
305+
if (atomic_inc_return(&rndis->notify_count) != 1)
306306
return;
307307

308308
/* Send RNDIS RESPONSE_AVAILABLE notification; a

0 commit comments

Comments
 (0)