stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "brcmfmac: check brcmf_bus_get_memdump result for error" has been added to the 4.9-stable tree
@ 2017-11-06  9:11 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-11-06  9:11 UTC (permalink / raw)
  To: rafal, alexander.levin, arend.vanspriel, gregkh, kvalo
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    brcmfmac: check brcmf_bus_get_memdump result for error

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     brcmfmac-check-brcmf_bus_get_memdump-result-for-error.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Mon Nov  6 10:07:35 CET 2017
From: Rafał Miłecki <rafal@milecki.pl>
Date: Sat, 7 Oct 2017 22:36:55 +0000
Subject: brcmfmac: check brcmf_bus_get_memdump result for error

From: Rafał Miłecki <rafal@milecki.pl>


[ Upstream commit f4737a62033d7f3e0db740c449fc62119da7ab8a ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c |   23 ++++++++++-----
 1 file changed, 16 insertions(+), 7 deletions(-)

--- 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;
 }
 


Patches currently in stable-queue which might be from rafal@milecki.pl are

queue-4.9/brcmfmac-check-brcmf_bus_get_memdump-result-for-error.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-06  9:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06  9:11 Patch "brcmfmac: check brcmf_bus_get_memdump result for error" has been added to the 4.9-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).