Skip to contentSkip to conversation

usb: gadget: raw_gadget: fix memory leak on connect event failure

PATCH Zhijian Han 2 participants 2 messages Nov 23 1 message not in the archive USB

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Greg Kroah-Hartman
Quoted 4 lines · hanzhijian

gadget_bind() allocates an ep0 request and stores it in dev->req. If raw_queue_event() fails to queue the connect event, the function returns without releasing the request, leaking it.

Quoted 7 lines
Quoted 5 lines

Release the request before returning in that case.

Full name please.

Apologies. Please use:

Best regards,
Zhijian Han

maintainer
#2 lore raw
Quoted 12 lines · Zhijian Han
Quoted 11 lines · Greg Kroah-Hartman
Quoted 9 lines · hanzhijian

gadget_bind() allocates an ep0 request and stores it in dev->req. If raw_queue_event() fails to queue the connect event, the function returns without releasing the request, leaking it.

Release the request before returning in that case.

Quoted 5 lines
Quoted 1 line

Full name please.

Apologies. Please use:

Please send a new version with this corrected