Browse Source

sunrpc: fix memory leak in unix_gid cache.

When we look up an entry in the uid->gidlist cache, we take
a reference to the content but don't drop the reference to the
cache entry.  So it never gets freed.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
NeilBrown 16 năm trước cách đây
mục cha
commit
560ab42ef9
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      net/sunrpc/svcauth_unix.c

+ 1 - 0
net/sunrpc/svcauth_unix.c

@@ -658,6 +658,7 @@ static int unix_gid_find(uid_t uid, struct group_info **gip,
 	case 0:
 		*gip = ug->gi;
 		get_group_info(*gip);
+		cache_put(&ug->h, &unix_gid_cache);
 		return 0;
 	default:
 		return -EAGAIN;