mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
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>
This commit is contained in:
parent
56d098b7ff
commit
95a4919ab7
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user