* [patch] staging: wilc1000: fix mgmt_tx()
@ 2016-02-10 9:05 Dan Carpenter
2016-02-10 9:41 ` walter harms
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-02-10 9:05 UTC (permalink / raw)
To: kernel-janitors
There was a missing curly brace so this function returns failure instead
of succeeding.
Fixes: 06fb9336acdc ('staging: wilc1000: wilc_wfi_cfgoperations.c: replaces PRINT_ER with netdev_err')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index bf264d3..97d1b80 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1832,9 +1832,10 @@ static int mgmt_tx(struct wiphy *wiphy,
return -EFAULT;
mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
- if (!mgmt_tx->buff)
+ if (!mgmt_tx->buff) {
kfree(mgmt_tx);
- return -EFAULT;
+ return -ENOMEM;
+ }
memcpy(mgmt_tx->buff, buf, len);
mgmt_tx->size = len;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] staging: wilc1000: fix mgmt_tx()
2016-02-10 9:05 [patch] staging: wilc1000: fix mgmt_tx() Dan Carpenter
@ 2016-02-10 9:41 ` walter harms
0 siblings, 0 replies; 2+ messages in thread
From: walter harms @ 2016-02-10 9:41 UTC (permalink / raw)
To: kernel-janitors
Am 10.02.2016 10:05, schrieb Dan Carpenter:
> There was a missing curly brace so this function returns failure instead
> of succeeding.
>
> Fixes: 06fb9336acdc ('staging: wilc1000: wilc_wfi_cfgoperations.c: replaces PRINT_ER with netdev_err')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index bf264d3..97d1b80 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -1832,9 +1832,10 @@ static int mgmt_tx(struct wiphy *wiphy,
> return -EFAULT;
>
> mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
> - if (!mgmt_tx->buff)
> + if (!mgmt_tx->buff) {
> kfree(mgmt_tx);
> - return -EFAULT;
> + return -ENOMEM;
> + }
>
> memcpy(mgmt_tx->buff, buf, len);
> mgmt_tx->size = len;
perhaps this is a case for kmemdup() ?
mgmt_tx->buff = kmemdup(buf, buf_len or len ?, GFP_KERNEL);
sorry, i can not see what len from this patch.
re,
wh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-10 9:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10 9:05 [patch] staging: wilc1000: fix mgmt_tx() Dan Carpenter
2016-02-10 9:41 ` walter harms
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.