From: Hante Meuleman Date: Thu, 13 Sep 2012 19:12:04 +0000 (+0200) Subject: brcmfmac: fix bug causing errorneous free on exception. X-Git-Tag: MMI-PSA29.97-13-9~15870^2~30^2~88 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9cd23a7191f1abc32252ba92494a910d5cc5fd02;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git brcmfmac: fix bug causing errorneous free on exception. This patch fixes bug where driver frees resources twice when an exception occurs. Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Hante Meuleman Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c index c6d5aeb27a02..03f59cd0572a 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c @@ -1340,10 +1340,8 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo, struct device *dev = devinfo->dev; bus_pub = brcmf_usb_attach(devinfo, BRCMF_USB_NRXQ, BRCMF_USB_NTXQ); - if (!bus_pub) { - ret = -ENODEV; - goto fail; - } + if (!bus_pub) + return -ENODEV; bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC); if (!bus) {