* [PATCH] staging: rtl8192e: rtllib_module: add free for error exit
@ 2021-12-27 8:07 Peiwei Hu
2021-12-27 17:42 ` Pavel Skripkin
0 siblings, 1 reply; 2+ messages in thread
From: Peiwei Hu @ 2021-12-27 8:07 UTC (permalink / raw
To: gregkh; +Cc: linux-staging, linux-kernel, trivial, Peiwei Hu
Original source code of alloc_rtllib returns directly in
error, without freeing variable dev.
Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>
---
drivers/staging/rtl8192e/rtllib_module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c
index 64d9feee1f39..18d898714c5c 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -125,7 +125,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
if (!ieee->pHTInfo)
- return NULL;
+ goto failed;
HTUpdateDefaultSetting(ieee);
HTInitializeHTInfo(ieee);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: rtl8192e: rtllib_module: add free for error exit
2021-12-27 8:07 [PATCH] staging: rtl8192e: rtllib_module: add free for error exit Peiwei Hu
@ 2021-12-27 17:42 ` Pavel Skripkin
0 siblings, 0 replies; 2+ messages in thread
From: Pavel Skripkin @ 2021-12-27 17:42 UTC (permalink / raw
To: Peiwei Hu, gregkh; +Cc: linux-staging, linux-kernel, trivial
On 12/27/21 11:07, Peiwei Hu wrote:
> Original source code of alloc_rtllib returns directly in
> error, without freeing variable dev.
>
> Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>
> ---
> drivers/staging/rtl8192e/rtllib_module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c
> index 64d9feee1f39..18d898714c5c 100644
> --- a/drivers/staging/rtl8192e/rtllib_module.c
> +++ b/drivers/staging/rtl8192e/rtllib_module.c
> @@ -125,7 +125,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
>
> ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
> if (!ieee->pHTInfo)
> - return NULL;
> + goto failed;
>
> HTUpdateDefaultSetting(ieee);
> HTInitializeHTInfo(ieee);
This one is already fixed in staging-testing branch. See commit
e730cd57ac2dfe94bca0f14a3be8e1b21de41a9c
With regards,
Pavel Skripkin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-27 17:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-27 8:07 [PATCH] staging: rtl8192e: rtllib_module: add free for error exit Peiwei Hu
2021-12-27 17:42 ` Pavel Skripkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).