summaryrefslogtreecommitdiffstats
path: root/drivers/dma/stm32-dma.c
diff options
context:
space:
mode:
authorArend Van Spriel <arend.vanspriel@broadcom.com>2017-06-24 22:08:27 +0100
committerKalle Valo <kvalo@codeaurora.org>2017-06-27 17:13:57 +0300
commitdca2307ed6250e7be6993e165570fa4097903a58 (patch)
treef818ed0d189e323f488c04b57b8e533df1cd1cb5 /drivers/dma/stm32-dma.c
parent593814d1beae8ad91be6c90f95764e09fc7ca236 (diff)
downloadtalos-op-linux-dca2307ed6250e7be6993e165570fa4097903a58.tar.gz
talos-op-linux-dca2307ed6250e7be6993e165570fa4097903a58.zip
brcmfmac: fix double free upon register_netdevice() failure
The function brcmf_net_attach() can only fail when register_netdevice() fails. When this happens register_netdevice() calls priv_destructor, ie. brcmf_cfg80211_free_netdev() freeing the vif instance. Also upon this failure brcmf_net_attach() calls free_netdev(). However, callers are also doing cleanup resulting in double free. In some places they need netdev private space as it holds parameters to communicate with the device. So we want to do the cleanup only in callers of brcmf_net_attach() by making the following changes: - set priv_destructor after register_netdevice() succeeds. - remove call to free_netdev() in brcmf_net_attach(). - call free_netdev() in brcmf_net_detach() for unregistered netdev. - add free_netdev() if brcmf_net_attach() fails for a created interface. Fixes: cf124db566e6 ("net: Fix inconsistent teardown and release of private netdev state.") Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/dma/stm32-dma.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud