aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
authorPhil Elwell <[email protected]>2017-09-24 14:20:49 +0000
committerGreg Kroah-Hartman <[email protected]>2017-10-18 13:09:45 +0000
commitc97d96b4e612c7dc1b37d7afc61b598a9a25994d (patch)
tree0e6b16525e082f13bf06a31c9a4fb5e09e9655a0 /lib/string.c
parentMerge tag 'iio-fixes-for-4.14b' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
downloadkernel-c97d96b4e612c7dc1b37d7afc61b598a9a25994d.tar.gz
kernel-c97d96b4e612c7dc1b37d7afc61b598a9a25994d.zip
staging: bcm2835-audio: Fix memory corruption
The previous commit (0adbfd46) fixed a memory leak but also freed a block in the success case, causing a stale pointer to be used with potentially fatal results. Only free the vchi_instance block in the case that vchi_connect fails; once connected, the instance is retained for subsequent connections. Simplifying the code by removing a bunch of gotos and returning errors directly. Signed-off-by: Phil Elwell <[email protected]> Fixes: 0adbfd4694c2 ("staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection()") Cc: stable <[email protected]> # 4.12+ Tested-by: Stefan Wahren <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/string.c')
0 files changed, 0 insertions, 0 deletions