mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
firewire: fix memory leak of fw_request instances
Found and debugged by Jay Fenlason <[email protected]>. The bug was especially noticeable with direct I/O over fw-sbp2. Signed-off-by: Stefan Richter <[email protected]> Signed-off-by: Kristian Høgsberg <[email protected]>
This commit is contained in:
parent
5d59a6f1ba
commit
9c9bdf4d50
2 changed files with 7 additions and 1 deletions
|
|
@ -605,8 +605,10 @@ fw_send_response(struct fw_card *card, struct fw_request *request, int rcode)
|
|||
* check is sufficient to ensure we don't send response to
|
||||
* broadcast packets or posted writes.
|
||||
*/
|
||||
if (request->ack != ACK_PENDING)
|
||||
if (request->ack != ACK_PENDING) {
|
||||
kfree(request);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rcode == RCODE_COMPLETE)
|
||||
fw_fill_response(&request->response, request->request_header,
|
||||
|
|
|
|||
|
|
@ -123,6 +123,10 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
|
|||
size_t length,
|
||||
void *callback_data);
|
||||
|
||||
/*
|
||||
* Important note: The callback must guarantee that either fw_send_response()
|
||||
* or kfree() is called on the @request.
|
||||
*/
|
||||
typedef void (*fw_address_callback_t)(struct fw_card *card,
|
||||
struct fw_request *request,
|
||||
int tcode, int destination, int source,
|
||||
|
|
|
|||
Loading…
Reference in a new issue