diff options
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/af_irda.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index b85fa22806f6..0a78f17006a4 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -2023,7 +2023,11 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, err = -EINVAL; goto out; } - irias_insert_object(ias_obj); + + /* Only insert newly allocated objects */ + if (free_ias) + irias_insert_object(ias_obj); + kfree(ias_opt); break; case IRLMP_IAS_DEL: |