[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4ea47b6-ba6d-1b6e-0d51-e5fcceca27d0@users.sourceforge.net>
Date: Wed, 13 Dec 2017 14:12:41 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: devel@...verdev.osuosl.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Maciek Borzecki <maciek.borzecki@...il.com>,
Simo Koskinen <koskisoft@...il.com>,
Thibaut Sautereau <thibaut.sautereau@...ecom-sudparis.eu>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/4] staging/wlan-ng/prism2fw: Use a known error code after a
failed kzalloc() in mkimage()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 13 Dec 2017 13:20:10 +0100
Make a memory allocation failure clearer by using the error code "-ENOMEM"
(instead of the constant "1") in this function.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/staging/wlan-ng/prism2fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 6888d1b093fa..efca9108dad8 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -558,7 +558,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt)
for (i = 0; i < *ccnt; i++) {
clist[i].data = kzalloc(clist[i].len, GFP_KERNEL);
if (!clist[i].data)
- return 1;
+ return -ENOMEM;
pr_debug("chunk[%d]: addr=0x%06x len=%d\n",
i, clist[i].addr, clist[i].len);
--
2.15.1
Powered by blists - more mailing lists