diff options
author | Archana <craechal@gmail.com> | 2023-03-11 15:12:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-16 11:43:42 +0300 |
commit | 95a4919ab7328cb9442c0f8f1cfe5c3931f007f1 (patch) | |
tree | a7bd980cdf09720a41992e8bc5936135ae73edc3 /drivers/staging/wlan-ng | |
parent | 56d098b7fff39aa91701f8612b131c174976f910 (diff) | |
download | linux-95a4919ab7328cb9442c0f8f1cfe5c3931f007f1.tar.xz |
staging: wlan-ng: small cleanup in writeimage()
It is cleaner to use "goto free_result;" as is being followed
in rest of the implementation of writeimage function, and
remove unnecessary kfree statements.
Signed-off-by: Archana <craechal@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/20230311121253.10225-1-craechal@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/prism2fw.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index 02a2191d5c4d..98ed9bb9192c 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -1008,12 +1008,11 @@ 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); netdev_err(wlandev->netdev, "%s: no memory for firmware download, aborting download\n", __func__); - return -ENOMEM; + result = -ENOMEM; + goto free_result; } /* Initialize the messages */ |