Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1299117 > unrolled thread
| Started by | Insu Yun <wuninsu@gmail.com> |
|---|---|
| First post | 2015-12-29 21:20 +0100 |
| Last post | 2015-12-30 15:40 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] mwifiex: correctly handling kzalloc Insu Yun <wuninsu@gmail.com> - 2015-12-29 21:20 +0100
Re: [PATCH] mwifiex: correctly handling kzalloc Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-30 02:40 +0100
Re: [PATCH] mwifiex: correctly handling kzalloc Kalle Valo <kvalo@codeaurora.org> - 2015-12-30 15:40 +0100
| From | Insu Yun <wuninsu@gmail.com> |
|---|---|
| Date | 2015-12-29 21:20 +0100 |
| Subject | [PATCH] mwifiex: correctly handling kzalloc |
| Message-ID | <qL8Uq-5fn-7@gated-at.bofh.it> |
Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
drivers/net/wireless/mwifiex/sdio.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 78a8474..a8af72d 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -2053,8 +2053,19 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
/* Allocate skb pointer buffers */
card->mpa_rx.skb_arr = kzalloc((sizeof(void *)) *
card->mp_agg_pkt_limit, GFP_KERNEL);
+ if (!card->mpa_rx.skb_arr) {
+ kfree(card->mp_regs);
+ return -ENOMEM;
+ }
+
card->mpa_rx.len_arr = kzalloc(sizeof(*card->mpa_rx.len_arr) *
card->mp_agg_pkt_limit, GFP_KERNEL);
+ if (!card->mpa_rx.len_arr) {
+ kfree(card->mp_regs);
+ kfree(card->mpa_rx.skb_arr);
+ return -ENOMEM;
+ }
+
ret = mwifiex_alloc_sdio_mpa_buffers(adapter,
card->mp_tx_agg_buf_size,
card->mp_rx_agg_buf_size);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2015-12-30 02:40 +0100 |
| Message-ID | <qLdU6-8gU-15@gated-at.bofh.it> |
| In reply to | #1299117 |
On Tue, Dec 29, 2015 at 10:17 PM, Insu Yun <wuninsu@gmail.com> wrote:
Empty commit message?
> Signed-off-by: Insu Yun <wuninsu@gmail.com>
> ---
> drivers/net/wireless/mwifiex/sdio.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
> index 78a8474..a8af72d 100644
> --- a/drivers/net/wireless/mwifiex/sdio.c
> +++ b/drivers/net/wireless/mwifiex/sdio.c
> @@ -2053,8 +2053,19 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
> /* Allocate skb pointer buffers */
> card->mpa_rx.skb_arr = kzalloc((sizeof(void *)) *
> card->mp_agg_pkt_limit, GFP_KERNEL);
Just noticed: Looks like good candidate for kcalloc or kmalloc_array,
whichever is suitable.
> + if (!card->mpa_rx.skb_arr) {
> + kfree(card->mp_regs);
> + return -ENOMEM;
> + }
> +
> card->mpa_rx.len_arr = kzalloc(sizeof(*card->mpa_rx.len_arr) *
> card->mp_agg_pkt_limit, GFP_KERNEL);
Ditto.
> + if (!card->mpa_rx.len_arr) {
> + kfree(card->mp_regs);
> + kfree(card->mpa_rx.skb_arr);
> + return -ENOMEM;
> + }
> +
> ret = mwifiex_alloc_sdio_mpa_buffers(adapter,
> card->mp_tx_agg_buf_size,
> card->mp_rx_agg_buf_size);
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Kalle Valo <kvalo@codeaurora.org> |
|---|---|
| Date | 2015-12-30 15:40 +0100 |
| Message-ID | <qLq4W-7OE-21@gated-at.bofh.it> |
| In reply to | #1299196 |
Andy Shevchenko <andy.shevchenko@gmail.com> writes: > On Tue, Dec 29, 2015 at 10:17 PM, Insu Yun <wuninsu@gmail.com> wrote: > > Empty commit message? Yeah, no empty commit log, please. And then you submit a new version remember to add v2, v3 and so on: http://kernelnewbies.org/FirstKernelPatch#head-5c81b3c517a1d0bbc24f92594cb734e155fcbbcb -- Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web