mirror of
https://github.com/versity/scoutfs.git
synced 2026-04-22 14:30:31 +00:00
Don't allocate zero size net info
Clients don't use the net conn info and specified that it has 0 size. The net layer would try and allocate a zero size region which returns the magic ZERO_SIZE_PTR, which it would then later try and free. While that works, it's a little goofy. We can avoid the allocation when the size is 0. The pointer will remain null which kfree also accepts. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -1345,10 +1345,12 @@ scoutfs_net_alloc_conn(struct super_block *sb,
|
||||
if (!conn)
|
||||
return NULL;
|
||||
|
||||
conn->info = kzalloc(info_size, GFP_NOFS);
|
||||
if (!conn->info) {
|
||||
kfree(conn);
|
||||
return NULL;
|
||||
if (info_size) {
|
||||
conn->info = kzalloc(info_size, GFP_NOFS);
|
||||
if (!conn->info) {
|
||||
kfree(conn);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
conn->workq = alloc_workqueue("scoutfs_net_%s",
|
||||
|
||||
Reference in New Issue
Block a user