aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda')
-rw-r--r--net/irda/discovery.c3
-rw-r--r--net/irda/irias_object.c16
2 files changed, 7 insertions, 12 deletions
diff --git a/net/irda/discovery.c b/net/irda/discovery.c
index c4ba5fa1446a..3fefc822c1c0 100644
--- a/net/irda/discovery.c
+++ b/net/irda/discovery.c
@@ -194,8 +194,7 @@ void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force)
194 194
195 /* Remove it from the log */ 195 /* Remove it from the log */
196 curr = hashbin_remove_this(log, (irda_queue_t *) curr); 196 curr = hashbin_remove_this(log, (irda_queue_t *) curr);
197 if (curr) 197 kfree(curr);
198 kfree(curr);
199 } 198 }
200 } 199 }
201 200
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__);