Skip to content

Commit

Permalink
usbip: tools: fix fd leakage in the function of read_attr_usbip_status
Browse files Browse the repository at this point in the history
We should close the fd before the return of read_attr_usbip_status.

Fixes: 3391ba0 ("usbip: tools: Extract generic code to be shared with vudc backend")
Signed-off-by: Hewenliang <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
hewenliang4 authored and gregkh committed Nov 7, 2019
1 parent 91feb01 commit 26a4d4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/usb/usbip/libsrc/usbip_host_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
}

value = atoi(status);

close(fd);
return value;
}

Expand Down

0 comments on commit 26a4d4c

Please sign in to comment.