summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/a2mp.h
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2016-11-29 20:50:30 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-29 17:36:43 +0100
commitfca0ca95c34dde7e735ef322c599dfa0b4a2deae (patch)
tree9e8853630e87d37a0bf1ed824647824200aca8c9 /net/bluetooth/a2mp.h
parentfd3ed14ed0790d37c1f82cbaf30838d09da0c39e (diff)
downloadlinux-fca0ca95c34dde7e735ef322c599dfa0b4a2deae.tar.gz
linux-fca0ca95c34dde7e735ef322c599dfa0b4a2deae.tar.bz2
linux-fca0ca95c34dde7e735ef322c599dfa0b4a2deae.zip
usb: return correct errno code when krealloc fails
In function wusb_dev_sec_add(), variable result takes the return value. Its value should be negative on failures. When function krealloc() is called, an earlier check of variable result guarantees that the value of result must not be less than "sizeof(*secd)", and result is not reassigned when krealloc() returns a NULL pointer. As a result, a positive value may be returned, which makes it impossible for the caller of wusb_dev_sec_add() to detect the error. This patch fixes the bug by assigning -ENOMEM to result when krealloc() returns NULL. Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/bluetooth/a2mp.h')
0 files changed, 0 insertions, 0 deletions