2013-03-06 20:17:33

by Syam Sidhardhan

[permalink] [raw]
Subject: [PATCH v1] tty: ipwireless: Remove redundant NULL check before kfree

From: Syam Sidhardhan <[email protected]>

kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <[email protected]>
---
v1 -> Corrected the from address.

drivers/tty/ipwireless/hardware.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index 97a511f..2c14842 100644
--- a/drivers/tty/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
@@ -1732,8 +1732,7 @@ void ipwireless_hardware_free(struct ipw_hardware *hw)
flush_work(&hw->work_rx);

for (i = 0; i < NL_NUM_OF_ADDRESSES; i++)
- if (hw->packet_assembler[i] != NULL)
- kfree(hw->packet_assembler[i]);
+ kfree(hw->packet_assembler[i]);

for (i = 0; i < NL_NUM_OF_PRIORITIES; i++)
list_for_each_entry_safe(tp, tq, &hw->tx_queue[i], queue) {
--
1.7.9.5


2013-03-08 13:26:59

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH v1] tty: ipwireless: Remove redundant NULL check before kfree

On Thu, 7 Mar 2013, [email protected] wrote:

> From: Syam Sidhardhan <[email protected]>
>
> kfree on NULL pointer is a no-op.
>
> Signed-off-by: Syam Sidhardhan <[email protected]>

With my ipwireless maintainer hat on:

Acked-by: Jiri Kosina <[email protected]>

Greg, could you please take it through tty tree?

Thanks,

--
Jiri Kosina
SUSE Labs

2013-03-08 17:47:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v1] tty: ipwireless: Remove redundant NULL check before kfree

On Fri, Mar 08, 2013 at 02:26:43PM +0100, Jiri Kosina wrote:
> On Thu, 7 Mar 2013, [email protected] wrote:
>
> > From: Syam Sidhardhan <[email protected]>
> >
> > kfree on NULL pointer is a no-op.
> >
> > Signed-off-by: Syam Sidhardhan <[email protected]>
>
> With my ipwireless maintainer hat on:
>
> Acked-by: Jiri Kosina <[email protected]>
>
> Greg, could you please take it through tty tree?

Ok, will do.

thanks,

greg k-h