Messages in this thread Patch in this message | | | Subject | [PATCH 2/4] staging/wlan-ng/prism2fw: Use a known error code after a failed kzalloc() in mkimage() | From | SF Markus Elfring <> | Date | Wed, 13 Dec 2017 14:12:41 +0100 |
| |
From: Markus Elfring <elfring@users.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@users.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
| |