aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/core/user_mad.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 56b9c2fa2ecc..9d912d6877ff 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -499,6 +499,7 @@ static int ib_umad_open(struct inode *inode, struct file *filp)
499static int ib_umad_close(struct inode *inode, struct file *filp) 499static int ib_umad_close(struct inode *inode, struct file *filp)
500{ 500{
501 struct ib_umad_file *file = filp->private_data; 501 struct ib_umad_file *file = filp->private_data;
502 struct ib_umad_packet *packet, *tmp;
502 int i; 503 int i;
503 504
504 for (i = 0; i < IB_UMAD_MAX_AGENTS; ++i) 505 for (i = 0; i < IB_UMAD_MAX_AGENTS; ++i)
@@ -507,6 +508,9 @@ static int ib_umad_close(struct inode *inode, struct file *filp)
507 ib_unregister_mad_agent(file->agent[i]); 508 ib_unregister_mad_agent(file->agent[i]);
508 } 509 }
509 510
511 list_for_each_entry_safe(packet, tmp, &file->recv_list, list)
512 kfree(packet);
513
510 kfree(file); 514 kfree(file);
511 515
512 return 0; 516 return 0;