diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-11-16 20:39:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-18 04:32:41 +0300 |
commit | d35ef8f846c72d84bfccf239c248c84f79c3a7e8 (patch) | |
tree | dd3b11543c59e224056177959bc16fe9120f31d9 /net/sctp | |
parent | 17e48577752a61197a7e5f4922db45b3a5af5068 (diff) | |
download | linux-d35ef8f846c72d84bfccf239c248c84f79c3a7e8.tar.xz |
rsi: fix memory leak on buf and usb_reg_buf
In the cases where len is too long, the error return path fails to
kfree allocated buffers buf and usb_reg_buf. The simplest fix is to
perform the sanity check on len before the allocations to avoid having
to do the kfree'ing in the first place.
Detected by CoverityScan, CID#1452258,1452259 ("Resource Leak")
Fixes: 59f73e2ae185 ("rsi: check length before USB read/write register")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
0 files changed, 0 insertions, 0 deletions