aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irias_object.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-11-08 12:41:34 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-08 12:41:34 -0500
commita51482bde22f99c63fbbb57d5d46cc666384e379 (patch)
tree5482ed1c0803edb2ffbd51035de921fb0f72d82b /net/irda/irias_object.c
parentac7c98eca88a854755475fcfe1b2bf5f97f90d99 (diff)
[NET]: kfree cleanup
From: Jesper Juhl <jesper.juhl@gmail.com> This is the net/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in net/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br> Acked-by: Marcel Holtmann <marcel@holtmann.org> Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'net/irda/irias_object.c')
-rw-r--r--net/irda/irias_object.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c
index 6fec428b4512..75f2666e8630 100644
--- a/net/irda/irias_object.c
+++ b/net/irda/irias_object.c
@@ -122,8 +122,7 @@ static void __irias_delete_attrib(struct ias_attrib *attrib)
122 IRDA_ASSERT(attrib != NULL, return;); 122 IRDA_ASSERT(attrib != NULL, return;);
123 IRDA_ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return;); 123 IRDA_ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return;);
124 124
125 if (attrib->name) 125 kfree(attrib->name);
126 kfree(attrib->name);
127 126
128 irias_delete_value(attrib->value); 127 irias_delete_value(attrib->value);
129 attrib->magic = ~IAS_ATTRIB_MAGIC; 128 attrib->magic = ~IAS_ATTRIB_MAGIC;
@@ -136,8 +135,7 @@ void __irias_delete_object(struct ias_object *obj)
136 IRDA_ASSERT(obj != NULL, return;); 135 IRDA_ASSERT(obj != NULL, return;);
137 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); 136 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
138 137
139 if (obj->name) 138 kfree(obj->name);
140 kfree(obj->name);
141 139
142 hashbin_delete(obj->attribs, (FREE_FUNC) __irias_delete_attrib); 140 hashbin_delete(obj->attribs, (FREE_FUNC) __irias_delete_attrib);
143 141
@@ -562,14 +560,12 @@ void irias_delete_value(struct ias_value *value)
562 /* No need to deallocate */ 560 /* No need to deallocate */
563 break; 561 break;
564 case IAS_STRING: 562 case IAS_STRING:
565 /* If string, deallocate string */ 563 /* Deallocate string */
566 if (value->t.string != NULL) 564 kfree(value->t.string);
567 kfree(value->t.string);
568 break; 565 break;
569 case IAS_OCT_SEQ: 566 case IAS_OCT_SEQ:
570 /* If byte stream, deallocate byte stream */ 567 /* Deallocate byte stream */
571 if (value->t.oct_seq != NULL) 568 kfree(value->t.oct_seq);
572 kfree(value->t.oct_seq);
573 break; 569 break;
574 default: 570 default:
575 IRDA_DEBUG(0, "%s(), Unknown value type!\n", __FUNCTION__); 571 IRDA_DEBUG(0, "%s(), Unknown value type!\n", __FUNCTION__);