linux-stable/drivers/staging
Phil Elwell c97d96b4e6 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 <phil@raspberrypi.org>
Fixes: 0adbfd4694 ("staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection()")
Cc: stable <stable@vger.kernel.org> # 4.12+
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 15:09:45 +02:00
..
android Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-09-14 18:13:32 -07:00
board
ccree staging: ccree: save ciphertext for CTS IV 2017-08-23 16:22:35 -07:00
clocking-wizard
comedi Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-09-14 18:13:32 -07:00
dgnc
emxx_udc
fbtft staging: fbtft: array underflow in fbtft_request_gpios_match() 2017-07-28 17:08:16 -07:00
fsl-dpaa2 staging: fsl-dpaa2/eth: fix off-by-one FD ctrl bitmaks 2017-09-01 15:53:12 +02:00
fsl-mc Merge 4.13-rc7 into staging-next 2017-08-28 15:26:48 +02:00
fwserial
gdm724x Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
goldfish staging: goldfish: (Coding Style) Fixed parenthesis alignment. 2017-08-31 18:21:37 +02:00
greybus media updates for v4.14-rc1 2017-09-07 12:53:14 -07:00
gs_fpgaboot staging: gs_fpgaboot: return valid error codes 2017-07-28 17:07:37 -07:00
iio staging: iio: ade7759: fix signed extension bug on shift of a u8 2017-09-30 21:13:34 +01:00
irda staging: irda: fix init level for irda core 2017-08-30 10:15:12 -07:00
ks7010 staging: ks7010: Fix coding style and remove checkpatch.pl warnings. 2017-08-31 18:13:25 +02:00
lustre Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-09-14 18:54:01 -07:00
media media: staging: atomisp: sh_css_calloc shall return a pointer to the allocated space 2017-09-05 07:29:29 -04:00
most staging: most: hdm_usb: Driver registration with module_driver macro 2017-08-27 19:59:10 +02:00
mt29f_spinand staging: mt29f_spinand: Enable the read ECC before program the page 2017-09-18 12:25:31 +02:00
netlogic net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
nvec staging: nvec: explicitly request exclusive reset control 2017-07-30 08:28:21 -07:00
octeon staging: octeon: fix line over 80 characters 2017-08-18 15:57:17 -07:00
octeon-usb
olpc_dcon staging: olpc_dcon: remove pointless debug printk in dcon_freeze_store() 2017-08-28 10:27:29 +02:00
pi433 staging: pi433: Move limit check to switch default to kill warning 2017-09-18 12:25:31 +02:00
rtl8188eu staging:rtl8188eu:core Fix remove unneccessary else block 2017-09-01 19:08:45 +02:00
rtl8192e Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
rtl8192u staging: rtl8192u: fix spelling mistake: "Senondary" -> "Secondary" 2017-07-27 21:51:06 -07:00
rtl8712 staging: rtl8712: constify usb_device_id 2017-08-18 15:57:16 -07:00
rtl8723bs staging: rtl8723bs: avoid null pointer dereference on pmlmepriv 2017-09-22 11:00:58 +02:00
rtlwifi staging: r8822be: fix null pointer dereferences with a null driver_adapter 2017-09-18 12:25:31 +02:00
rts5208 SCSI misc on 20170907 2017-09-07 21:11:05 -07:00
skein staging: skein: move macros into header file 2017-07-28 17:06:43 -07:00
sm750fb staging: sm750fb: avoid conflicting vesafb 2017-07-18 08:53:45 +02:00
speakup staging: speakup: fix speakup-r empty line lockup 2017-09-18 12:25:31 +02:00
typec staging: typec: fusb302: make structure fusb302_psy_desc static 2017-09-01 19:06:44 +02:00
unisys staging: unisys/visorbus: add __init/__exit annotations 2017-09-18 12:25:31 +02:00
vboxvideo Staging/IIO driver updates for 4.14-rc1 2017-09-05 10:36:26 -07:00
vc04_services staging: bcm2835-audio: Fix memory corruption 2017-10-18 15:09:45 +02:00
vme
vt6655 Staging: vt6655: Fixing coding style warnings 2017-07-18 09:00:24 +02:00
vt6656 staging: vt6656: Use variable instead of its type in sizeof(...) 2017-07-16 08:41:02 +02:00
wilc1000 staging: wilc1000: fix spelling mistake: "Iinitialization" -> "initialization" 2017-07-30 08:28:21 -07:00
wlan-ng staging: wlan-ng: hfa384x_usb: Fix multiple line dereference 2017-08-20 11:10:23 -07:00
xgifb staging: fb_xgi: vb_table: Remove white space after tabstop 2017-06-23 19:36:49 +02:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-09-06 14:45:08 -07:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-09-06 14:45:08 -07:00