diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-10-28 16:53:13 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 16:53:13 -0400 |
commit | b4558ea93d66a43f7990d26f145fd4c54a01c9bf (patch) | |
tree | 70aa8ba4864f8ee994b7f5278f5045af6a646d34 /include/net | |
parent | 7380a78a973a8109c13cb0e47617c456b6f6e1f5 (diff) |
drivers/net: Remove pointless checks for NULL prior to calling kfree()
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ax25.h | 3 | ||||
-rw-r--r-- | include/net/netrom.h | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h index 30bb4a893237..2250a18b0cbb 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -237,8 +237,7 @@ typedef struct ax25_cb { | |||
237 | static __inline__ void ax25_cb_put(ax25_cb *ax25) | 237 | static __inline__ void ax25_cb_put(ax25_cb *ax25) |
238 | { | 238 | { |
239 | if (atomic_dec_and_test(&ax25->refcount)) { | 239 | if (atomic_dec_and_test(&ax25->refcount)) { |
240 | if (ax25->digipeat) | 240 | kfree(ax25->digipeat); |
241 | kfree(ax25->digipeat); | ||
242 | kfree(ax25); | 241 | kfree(ax25); |
243 | } | 242 | } |
244 | } | 243 | } |
diff --git a/include/net/netrom.h b/include/net/netrom.h index a6bf6e0f606a..a5ee53bce62f 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
@@ -136,8 +136,7 @@ static __inline__ void nr_node_put(struct nr_node *nr_node) | |||
136 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) | 136 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) |
137 | { | 137 | { |
138 | if (atomic_dec_and_test(&nr_neigh->refcount)) { | 138 | if (atomic_dec_and_test(&nr_neigh->refcount)) { |
139 | if (nr_neigh->digipeat != NULL) | 139 | kfree(nr_neigh->digipeat); |
140 | kfree(nr_neigh->digipeat); | ||
141 | kfree(nr_neigh); | 140 | kfree(nr_neigh); |
142 | } | 141 | } |
143 | } | 142 | } |