mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[NET]: kfree cleanup
From: Jesper Juhl <[email protected]> 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 <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
parent
ac7c98eca8
commit
a51482bde2
47 changed files with 99 additions and 191 deletions
|
|
@ -194,8 +194,7 @@ void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force)
|
|||
|
||||
/* Remove it from the log */
|
||||
curr = hashbin_remove_this(log, (irda_queue_t *) curr);
|
||||
if (curr)
|
||||
kfree(curr);
|
||||
kfree(curr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,8 +122,7 @@ static void __irias_delete_attrib(struct ias_attrib *attrib)
|
|||
IRDA_ASSERT(attrib != NULL, return;);
|
||||
IRDA_ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return;);
|
||||
|
||||
if (attrib->name)
|
||||
kfree(attrib->name);
|
||||
kfree(attrib->name);
|
||||
|
||||
irias_delete_value(attrib->value);
|
||||
attrib->magic = ~IAS_ATTRIB_MAGIC;
|
||||
|
|
@ -136,8 +135,7 @@ void __irias_delete_object(struct ias_object *obj)
|
|||
IRDA_ASSERT(obj != NULL, return;);
|
||||
IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
|
||||
|
||||
if (obj->name)
|
||||
kfree(obj->name);
|
||||
kfree(obj->name);
|
||||
|
||||
hashbin_delete(obj->attribs, (FREE_FUNC) __irias_delete_attrib);
|
||||
|
||||
|
|
@ -562,14 +560,12 @@ void irias_delete_value(struct ias_value *value)
|
|||
/* No need to deallocate */
|
||||
break;
|
||||
case IAS_STRING:
|
||||
/* If string, deallocate string */
|
||||
if (value->t.string != NULL)
|
||||
kfree(value->t.string);
|
||||
/* Deallocate string */
|
||||
kfree(value->t.string);
|
||||
break;
|
||||
case IAS_OCT_SEQ:
|
||||
/* If byte stream, deallocate byte stream */
|
||||
if (value->t.oct_seq != NULL)
|
||||
kfree(value->t.oct_seq);
|
||||
/* Deallocate byte stream */
|
||||
kfree(value->t.oct_seq);
|
||||
break;
|
||||
default:
|
||||
IRDA_DEBUG(0, "%s(), Unknown value type!\n", __FUNCTION__);
|
||||
|
|
|
|||
Loading…
Reference in a new issue