diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-05-03 17:33:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-05-03 17:33:27 -0400 |
commit | 6a5d362120a61a719095443194cc2d5e9a7027dd (patch) | |
tree | 7cab13ff0d252b96f4eeda7475f805ffdd1c0c4a /drivers/net/wan/cycx_x25.c | |
parent | db46edc6d3b66bf708a8f23a9aa89f63a49ebe33 (diff) |
[WAN]: kfree of NULL pointer is valid
kfree(0) is perfectly valid, checking pointers for NULL before calling
kfree() on them is redundant. The patch below cleans away a few such
redundant checks (and while I was around some of those bits I couldn't
stop myself from making a few tiny whitespace changes as well).
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Acked-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/cycx_x25.c')
-rw-r--r-- | drivers/net/wan/cycx_x25.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c index 5b48cd8568f..02d57c0b424 100644 --- a/drivers/net/wan/cycx_x25.c +++ b/drivers/net/wan/cycx_x25.c | |||
@@ -436,9 +436,7 @@ static int cycx_wan_new_if(struct wan_device *wandev, struct net_device *dev, | |||
436 | } | 436 | } |
437 | 437 | ||
438 | if (err) { | 438 | if (err) { |
439 | if (chan->local_addr) | 439 | kfree(chan->local_addr); |
440 | kfree(chan->local_addr); | ||
441 | |||
442 | kfree(chan); | 440 | kfree(chan); |
443 | return err; | 441 | return err; |
444 | } | 442 | } |
@@ -458,9 +456,7 @@ static int cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev) | |||
458 | struct cycx_x25_channel *chan = dev->priv; | 456 | struct cycx_x25_channel *chan = dev->priv; |
459 | 457 | ||
460 | if (chan->svc) { | 458 | if (chan->svc) { |
461 | if (chan->local_addr) | 459 | kfree(chan->local_addr); |
462 | kfree(chan->local_addr); | ||
463 | |||
464 | if (chan->state == WAN_CONNECTED) | 460 | if (chan->state == WAN_CONNECTED) |
465 | del_timer(&chan->timer); | 461 | del_timer(&chan->timer); |
466 | } | 462 | } |