diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2017-02-10 00:17:08 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2017-02-10 00:40:49 +0100 |
commit | 368cc8ef47b3237c6c08df52bb70210cfc7647b6 (patch) | |
tree | 284d3da2a5e916b4ac8f82faba986bd5197ff740 /package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch | |
parent | 41ad9ed13a7792775ad3cca88e9d4eac6e594c63 (diff) | |
download | mtk-20170518-368cc8ef47b3237c6c08df52bb70210cfc7647b6.zip mtk-20170518-368cc8ef47b3237c6c08df52bb70210cfc7647b6.tar.gz mtk-20170518-368cc8ef47b3237c6c08df52bb70210cfc7647b6.tar.bz2 |
mac80211: update brcmfmac backporting brcmf_err cleanups
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch')
-rw-r--r-- | package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch b/package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch new file mode 100644 index 0000000..4ae4c60 --- /dev/null +++ b/package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch @@ -0,0 +1,52 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> +Date: Mon, 30 Jan 2017 16:09:51 +0100 +Subject: [PATCH] brcmfmac: check brcmf_bus_get_memdump result for error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This method may be unsupported (see: USB bus) or may just fail (see: +SDIO bus). +While at it rework logic in brcmf_sdio_bus_get_memdump function to avoid +too many conditional code nesting levels. + +Signed-off-by: Rafał Miłecki <rafal@milecki.pl> +Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c +@@ -32,16 +32,25 @@ static int brcmf_debug_create_memdump(st + { + void *dump; + size_t ramsize; ++ int err; + + ramsize = brcmf_bus_get_ramsize(bus); +- if (ramsize) { +- dump = vzalloc(len + ramsize); +- if (!dump) +- return -ENOMEM; +- memcpy(dump, data, len); +- brcmf_bus_get_memdump(bus, dump + len, ramsize); +- dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL); ++ if (!ramsize) ++ return -ENOTSUPP; ++ ++ dump = vzalloc(len + ramsize); ++ if (!dump) ++ return -ENOMEM; ++ ++ memcpy(dump, data, len); ++ err = brcmf_bus_get_memdump(bus, dump + len, ramsize); ++ if (err) { ++ vfree(dump); ++ return err; + } ++ ++ dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL); ++ + return 0; + } + |