* [PATCH] Checks for Null return of skb_alloc in function fw_download_code
@ 2014-06-18 17:53 Nicholas Krause
2014-06-18 18:14 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Krause @ 2014-06-18 17:53 UTC (permalink / raw)
To: gregkh; +Cc: lisa, valentina.manea.m, ben, devel, linux-kernel
Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 11e915e..fde17ff 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -62,12 +62,15 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
skb = dev_alloc_skb(frag_length + 4);
+ if (!skb) {
+ rt_status = false;
+ return rt_status;
+
+ }
memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE;
tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
tcb_desc->bLastIniPkt = bLastIniPkt;
- }
seg_ptr = skb->data;
for (i = 0; i < frag_length; i += 4) {
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Checks for Null return of skb_alloc in function fw_download_code
2014-06-18 17:53 [PATCH] Checks for Null return of skb_alloc in function fw_download_code Nicholas Krause
@ 2014-06-18 18:14 ` Greg KH
2014-06-18 20:59 ` Nick Krause
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2014-06-18 18:14 UTC (permalink / raw)
To: Nicholas Krause; +Cc: devel, ben, lisa, valentina.manea.m, linux-kernel
On Wed, Jun 18, 2014 at 01:53:00PM -0400, Nicholas Krause wrote:
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
> index 11e915e..fde17ff 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
> @@ -62,12 +62,15 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
>
> skb = dev_alloc_skb(frag_length + 4);
> + if (!skb) {
> + rt_status = false;
> + return rt_status;
> +
> + }
Why 2 tabs for indentation? Does that look correct?
> memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
> tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
> tcb_desc->queue_index = TXCMD_QUEUE;
> tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
> tcb_desc->bLastIniPkt = bLastIniPkt;
> - }
>
> seg_ptr = skb->data;
> for (i = 0; i < frag_length; i += 4) {
Also, this patch still fails to apply, what tree did you make it
against? A "clean" 3.16-rc1 tree, or your own tree with other changes
in it?
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Checks for Null return of skb_alloc in function fw_download_code
2014-06-18 18:14 ` Greg KH
@ 2014-06-18 20:59 ` Nick Krause
0 siblings, 0 replies; 3+ messages in thread
From: Nick Krause @ 2014-06-18 20:59 UTC (permalink / raw)
To: Greg KH; +Cc: devel, ben, lisa, Valentina Manea, linux-kernel
So sorry Greg,
I pulled the git in this morning for kernel-3.16-r2 ,I will resend the
patch from the clean tree.
I will also fix the tabs.'
Sorry :( Nick
On Wed, Jun 18, 2014 at 2:14 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Jun 18, 2014 at 01:53:00PM -0400, Nicholas Krause wrote:
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> ---
>> drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
>> index 11e915e..fde17ff 100644
>> --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
>> +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
>> @@ -62,12 +62,15 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
>>
>> skb = dev_alloc_skb(frag_length + 4);
>> + if (!skb) {
>> + rt_status = false;
>> + return rt_status;
>> +
>> + }
>
> Why 2 tabs for indentation? Does that look correct?
>
>> memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
>> tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
>> tcb_desc->queue_index = TXCMD_QUEUE;
>> tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
>> tcb_desc->bLastIniPkt = bLastIniPkt;
>> - }
>>
>> seg_ptr = skb->data;
>> for (i = 0; i < frag_length; i += 4) {
>
> Also, this patch still fails to apply, what tree did you make it
> against? A "clean" 3.16-rc1 tree, or your own tree with other changes
> in it?
>
> greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-18 20:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 17:53 [PATCH] Checks for Null return of skb_alloc in function fw_download_code Nicholas Krause
2014-06-18 18:14 ` Greg KH
2014-06-18 20:59 ` Nick Krause
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox