linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [V2 PATCH 0/3] staging : ozwpan: Remove NULL pointer check
       [not found] <20121120163513.GC4990@kroah.com>
@ 2012-11-21 12:46 ` Rupesh Gujare
  2012-11-21 12:46 ` [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c Rupesh Gujare
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Rupesh Gujare @ 2012-11-21 12:46 UTC (permalink / raw)
  To: devel; +Cc: linux-kernel, gregkh, sachin.kamat

This patch series removes NULL pointer check before kfree

Rupesh Gujare (3):
  staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  staging: ozwpan: Remove redundant null check before kfree in
    ozproto.c
  staging: ozwpan: Remove redundant null check before kfree in ozhcd.c

 drivers/staging/ozwpan/ozhcd.c   |    6 +++---
 drivers/staging/ozwpan/ozpd.c    |    6 +++---
 drivers/staging/ozwpan/ozproto.c |    6 ++----
 3 files changed, 8 insertions(+), 10 deletions(-)

-- 
1.7.5.4



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
       [not found] <20121120163513.GC4990@kroah.com>
  2012-11-21 12:46 ` [V2 PATCH 0/3] staging : ozwpan: Remove NULL pointer check Rupesh Gujare
@ 2012-11-21 12:46 ` Rupesh Gujare
  2012-11-21 13:05   ` Dan Carpenter
  2012-11-21 12:46 ` [V2 PATCH 2/3] staging: ozwpan: Remove redundant null check before kfree in ozproto.c Rupesh Gujare
  2012-11-21 12:46 ` [V2 PATCH 3/3] staging: ozwpan: Remove redundant null check before kfree in ozhcd.c Rupesh Gujare
  3 siblings, 1 reply; 11+ messages in thread
From: Rupesh Gujare @ 2012-11-21 12:46 UTC (permalink / raw)
  To: devel; +Cc: linux-kernel, gregkh, sachin.kamat

Call kfree only if required else return from function.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
---
 drivers/staging/ozwpan/ozpd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 0b3648c..1dd8980 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -399,11 +399,11 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f)
 		f->link.next = pd->tx_pool;
 		pd->tx_pool = &f->link;
 		pd->tx_pool_count++;
-		f = 0;
+		spin_unlock_bh(&pd->tx_frame_lock);
+		return;
 	}
 	spin_unlock_bh(&pd->tx_frame_lock);
-	if (f)
-		kfree(f);
+	kfree(f);
 }
 /*------------------------------------------------------------------------------
  * Context: softirq-serialized
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [V2 PATCH 2/3] staging: ozwpan: Remove redundant null check before kfree in ozproto.c
       [not found] <20121120163513.GC4990@kroah.com>
  2012-11-21 12:46 ` [V2 PATCH 0/3] staging : ozwpan: Remove NULL pointer check Rupesh Gujare
  2012-11-21 12:46 ` [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c Rupesh Gujare
@ 2012-11-21 12:46 ` Rupesh Gujare
  2012-11-21 12:46 ` [V2 PATCH 3/3] staging: ozwpan: Remove redundant null check before kfree in ozhcd.c Rupesh Gujare
  3 siblings, 0 replies; 11+ messages in thread
From: Rupesh Gujare @ 2012-11-21 12:46 UTC (permalink / raw)
  To: devel; +Cc: linux-kernel, gregkh, sachin.kamat

Free memory if timer pool count > OZ_MAX_TIMER_POOL_SIZE

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
---
 drivers/staging/ozwpan/ozproto.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c
index cfb5160..832fde1 100644
--- a/drivers/staging/ozwpan/ozproto.c
+++ b/drivers/staging/ozwpan/ozproto.c
@@ -552,8 +552,8 @@ static void oz_protocol_timer(unsigned long arg)
 			t->link.next = g_timer_pool;
 			g_timer_pool = &t->link;
 			g_timer_pool_count++;
-			t = 0;
-		}
+		} else
+			kfree(t);
 		if (!list_empty(&g_timer_list)) {
 			t2 =  container_of(g_timer_list.next,
 				struct oz_timer, link);
@@ -566,8 +566,6 @@ static void oz_protocol_timer(unsigned long arg)
 		}
 		spin_unlock_bh(&g_polling_lock);
 		oz_pd_put(pd);
-		if (t)
-			kfree(t);
 		t = t2;
 	} while (t);
 	g_timer_state = OZ_TIMER_IDLE;
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [V2 PATCH 3/3] staging: ozwpan: Remove redundant null check before kfree in ozhcd.c
       [not found] <20121120163513.GC4990@kroah.com>
                   ` (2 preceding siblings ...)
  2012-11-21 12:46 ` [V2 PATCH 2/3] staging: ozwpan: Remove redundant null check before kfree in ozproto.c Rupesh Gujare
@ 2012-11-21 12:46 ` Rupesh Gujare
  3 siblings, 0 replies; 11+ messages in thread
From: Rupesh Gujare @ 2012-11-21 12:46 UTC (permalink / raw)
  To: devel; +Cc: linux-kernel, gregkh, sachin.kamat

Call kfree only if required else return from function.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
---
 drivers/staging/ozwpan/ozhcd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 33c0009..585aa79 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -274,12 +274,12 @@ static void oz_free_urb_link(struct oz_urb_link *urbl)
 		if (g_link_pool_size < OZ_MAX_LINK_POOL_SIZE) {
 			urbl->link.next = g_link_pool;
 			g_link_pool = &urbl->link;
-			urbl = 0;
 			g_link_pool_size++;
+			spin_unlock_irqrestore(&g_link_lock, irq_state);
+			return;
 		}
 		spin_unlock_irqrestore(&g_link_lock, irq_state);
-		if (urbl)
-			kfree(urbl);
+		kfree(urbl);
 	}
 }
 /*------------------------------------------------------------------------------
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  2012-11-21 12:46 ` [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c Rupesh Gujare
@ 2012-11-21 13:05   ` Dan Carpenter
  2012-11-21 13:42     ` Rupesh Gujare
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Carpenter @ 2012-11-21 13:05 UTC (permalink / raw)
  To: Rupesh Gujare; +Cc: devel, sachin.kamat, gregkh, linux-kernel

On Wed, Nov 21, 2012 at 12:46:15PM +0000, Rupesh Gujare wrote:
> Call kfree only if required else return from function.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>

I'm not sure this is right.

Signed-off-by is intended to have a legal meaning that you are
signing off that you have permission to submit the patch.  You're
not allowed to sign off on behalf of someone else.

If we apply this as is, then you get the author credit.  If you want
to give Sachin author credit then make the first line of the email:

From: Sachin Kamat <sachin.kamat@linaro.org>

Also it's not a good idea to get too control freaky over this code
which is all going to have to be replaced before this can graduate
out of staging.  You're just going to discourage people from
contributing if you redo all their patches.  Linaro people are the
real deal and you should let them help.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  2012-11-21 13:05   ` Dan Carpenter
@ 2012-11-21 13:42     ` Rupesh Gujare
  2012-11-21 16:19       ` Dan Carpenter
  0 siblings, 1 reply; 11+ messages in thread
From: Rupesh Gujare @ 2012-11-21 13:42 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, sachin.kamat, gregkh, linux-kernel

On 21/11/12 13:05, Dan Carpenter wrote:
> On Wed, Nov 21, 2012 at 12:46:15PM +0000, Rupesh Gujare wrote:
>> Call kfree only if required else return from function.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
> I'm not sure this is right.
>
> Signed-off-by is intended to have a legal meaning that you are
> signing off that you have permission to submit the patch.  You're
> not allowed to sign off on behalf of someone else.
>
> If we apply this as is, then you get the author credit.  If you want
> to give Sachin author credit then make the first line of the email:
>
> From: Sachin Kamat <sachin.kamat@linaro.org>

All right, thats my mistake. I did not understood "signed-off-by" 
properly  . All my intention was to acknowledge original author's 
contribution and make changes which are good for driver code. I am more 
than happy to resend this patch series if I am allowed to use someone 
else credentials (which I felt is wrong)

Please let me know what is a best way to do it.

>
> Also it's not a good idea to get too control freaky over this code
> which is all going to have to be replaced before this can graduate
> out of staging.  You're just going to discourage people from
> contributing if you redo all their patches.  Linaro people are the
> real deal and you should let them help.
>
>

Only intention to redo this patch series is that, new code implemented 
seems more logical to me. I welcome any criticism of code, & I am very 
much happy to accept any contributions, as done in past.


-- 
Regards,
Rupesh Gujare



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  2012-11-21 13:42     ` Rupesh Gujare
@ 2012-11-21 16:19       ` Dan Carpenter
  2012-11-21 17:26         ` Rupesh Gujare
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Carpenter @ 2012-11-21 16:19 UTC (permalink / raw)
  To: Rupesh Gujare; +Cc: devel, sachin.kamat, gregkh, linux-kernel

When someone sends a patch there are a several possible responses:
1) Ack the patch.
2) Request that the submitter redo it.  The downside is that no one
   likes redoing patches.
3) Reject the patch.
4) Redo it yourself and say "Based on a patch from Sachin Kamat".
   This isn't nice because everyone wants author credit.
5) Redo it and get permission from the original author to give them
   author credit get their signed-off-by.

Your version is better, that's not even a question.  It's just that
now we're in an awkward place and having long discussions about
trivial patches that are going to be re-written anyway.  :P

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  2012-11-21 16:19       ` Dan Carpenter
@ 2012-11-21 17:26         ` Rupesh Gujare
  2012-11-21 21:48           ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Rupesh Gujare @ 2012-11-21 17:26 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, sachin.kamat, gregkh, linux-kernel

On 21/11/12 16:19, Dan Carpenter wrote:
> When someone sends a patch there are a several possible responses:
> 1) Ack the patch.
> 2) Request that the submitter redo it.  The downside is that no one
>     likes redoing patches.
> 3) Reject the patch.
> 4) Redo it yourself and say "Based on a patch from Sachin Kamat".
>     This isn't nice because everyone wants author credit.
> 5) Redo it and get permission from the original author to give them
>     author credit get their signed-off-by.
>
>
Thanks Dan

I will keep it in mind in future.

Sachin,

Are you interested in redoing (or sending sign-off ?) for this patch 
series ? I am more than happy to accept either.

-- 
Regards,
Rupesh Gujare



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  2012-11-21 17:26         ` Rupesh Gujare
@ 2012-11-21 21:48           ` Greg KH
  2012-11-21 23:10             ` Rupesh Gujare
  0 siblings, 1 reply; 11+ messages in thread
From: Greg KH @ 2012-11-21 21:48 UTC (permalink / raw)
  To: Rupesh Gujare; +Cc: Dan Carpenter, devel, sachin.kamat, linux-kernel

On Wed, Nov 21, 2012 at 05:26:12PM +0000, Rupesh Gujare wrote:
> On 21/11/12 16:19, Dan Carpenter wrote:
> >When someone sends a patch there are a several possible responses:
> >1) Ack the patch.
> >2) Request that the submitter redo it.  The downside is that no one
> >    likes redoing patches.
> >3) Reject the patch.
> >4) Redo it yourself and say "Based on a patch from Sachin Kamat".
> >    This isn't nice because everyone wants author credit.
> >5) Redo it and get permission from the original author to give them
> >    author credit get their signed-off-by.
> >
> >
> Thanks Dan
> 
> I will keep it in mind in future.
> 
> Sachin,
> 
> Are you interested in redoing (or sending sign-off ?) for this patch
> series ? I am more than happy to accept either.

Don't worry, I'll clean up the mess here...


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  2012-11-21 21:48           ` Greg KH
@ 2012-11-21 23:10             ` Rupesh Gujare
  2012-11-21 23:14               ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Rupesh Gujare @ 2012-11-21 23:10 UTC (permalink / raw)
  To: Greg KH; +Cc: Dan Carpenter, devel, sachin.kamat, linux-kernel

On 21/11/12 21:48, Greg KH wrote:
> On Wed, Nov 21, 2012 at 05:26:12PM +0000, Rupesh Gujare wrote:
>> On 21/11/12 16:19, Dan Carpenter wrote:
>>> When someone sends a patch there are a several possible responses:
>>> 1) Ack the patch.
>>> 2) Request that the submitter redo it.  The downside is that no one
>>>     likes redoing patches.
>>> 3) Reject the patch.
>>> 4) Redo it yourself and say "Based on a patch from Sachin Kamat".
>>>     This isn't nice because everyone wants author credit.
>>> 5) Redo it and get permission from the original author to give them
>>>     author credit get their signed-off-by.
>>>
>>>
>> Thanks Dan
>>
>> I will keep it in mind in future.
>>
>> Sachin,
>>
>> Are you interested in redoing (or sending sign-off ?) for this patch
>> series ? I am more than happy to accept either.
> Don't worry, I'll clean up the mess here...
>
>
Sorry Greg,

But looks like you applied V1 of this patch series, rather than V2. Is 
that intentional ?

Below is link for V2 :-

http://driverdev.linuxdriverproject.org/pipermail/devel/2012-November/033339.html

& yes, V2 is missing -

From: Sachin Kamat<sachin.kamat@linaro.org>



-- 
Regards,
Rupesh Gujare



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c
  2012-11-21 23:10             ` Rupesh Gujare
@ 2012-11-21 23:14               ` Greg KH
  0 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2012-11-21 23:14 UTC (permalink / raw)
  To: Rupesh Gujare; +Cc: devel, sachin.kamat, linux-kernel, Dan Carpenter

On Wed, Nov 21, 2012 at 11:10:12PM +0000, Rupesh Gujare wrote:
> On 21/11/12 21:48, Greg KH wrote:
> >On Wed, Nov 21, 2012 at 05:26:12PM +0000, Rupesh Gujare wrote:
> >>On 21/11/12 16:19, Dan Carpenter wrote:
> >>>When someone sends a patch there are a several possible responses:
> >>>1) Ack the patch.
> >>>2) Request that the submitter redo it.  The downside is that no one
> >>>    likes redoing patches.
> >>>3) Reject the patch.
> >>>4) Redo it yourself and say "Based on a patch from Sachin Kamat".
> >>>    This isn't nice because everyone wants author credit.
> >>>5) Redo it and get permission from the original author to give them
> >>>    author credit get their signed-off-by.
> >>>
> >>>
> >>Thanks Dan
> >>
> >>I will keep it in mind in future.
> >>
> >>Sachin,
> >>
> >>Are you interested in redoing (or sending sign-off ?) for this patch
> >>series ? I am more than happy to accept either.
> >Don't worry, I'll clean up the mess here...
> >
> >
> Sorry Greg,
> 
> But looks like you applied V1 of this patch series, rather than V2.
> Is that intentional ?

Yes.

You got the authorship version wrong on your set of patches, so I took
V1 which correctly handled it.

And, I commented on your one different patch.  Please resend anything,
based on the patches I took, if you want to see them done differently.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-11-22 21:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20121120163513.GC4990@kroah.com>
2012-11-21 12:46 ` [V2 PATCH 0/3] staging : ozwpan: Remove NULL pointer check Rupesh Gujare
2012-11-21 12:46 ` [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c Rupesh Gujare
2012-11-21 13:05   ` Dan Carpenter
2012-11-21 13:42     ` Rupesh Gujare
2012-11-21 16:19       ` Dan Carpenter
2012-11-21 17:26         ` Rupesh Gujare
2012-11-21 21:48           ` Greg KH
2012-11-21 23:10             ` Rupesh Gujare
2012-11-21 23:14               ` Greg KH
2012-11-21 12:46 ` [V2 PATCH 2/3] staging: ozwpan: Remove redundant null check before kfree in ozproto.c Rupesh Gujare
2012-11-21 12:46 ` [V2 PATCH 3/3] staging: ozwpan: Remove redundant null check before kfree in ozhcd.c Rupesh Gujare

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 NNTP newsgroup(s).