Messages in this thread Patch in this message | | | Subject | [PATCH 4/4] staging/wlan-ng/prism2fw: Use common error handling code in writeimage() | From | SF Markus Elfring <> | Date | Wed, 13 Dec 2017 14:14:26 +0100 |
| |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 13 Dec 2017 13:41:41 +0100
Replace two calls of the function "kfree" by a jump to the same statements at the end of this function so that the generated object code could become a bit smaller.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/staging/wlan-ng/prism2fw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index e6f7ed17106a..42ad5ff7772e 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -1012,9 +1012,8 @@ static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk, rstmsg = kzalloc(sizeof(*rstmsg), GFP_KERNEL); rwrmsg = kzalloc(sizeof(*rwrmsg), GFP_KERNEL); if (!rstmsg || !rwrmsg) { - kfree(rstmsg); - kfree(rwrmsg); - return -ENOMEM; + result = -ENOMEM; + goto free_result; } /* Initialize the messages */ -- 2.15.1
| |