Commit e5380527 authored by Roland Dreier's avatar Roland Dreier
Browse files

IB/ipath: Really run work in ipath_release_user_pages_on_close()



ipath_release_user_pages_on_close() just allocated a structure to
schedule work with but just returned (leaking the structure) rather than 
actually doing schedule_work().  Fix the logic to what was intended.

This was spotted by the Coverity checker (CID 2700).

Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 71c45122
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -209,20 +209,20 @@ void ipath_release_user_pages_on_close(struct page **p, size_t num_pages)


	mm = get_task_mm(current);
	mm = get_task_mm(current);
	if (!mm)
	if (!mm)
		goto bail;
		return;


	work = kmalloc(sizeof(*work), GFP_KERNEL);
	work = kmalloc(sizeof(*work), GFP_KERNEL);
	if (!work)
	if (!work)
		goto bail_mm;
		goto bail_mm;


	goto bail;

	INIT_WORK(&work->work, user_pages_account);
	INIT_WORK(&work->work, user_pages_account);
	work->mm = mm;
	work->mm = mm;
	work->num_pages = num_pages;
	work->num_pages = num_pages;


	schedule_work(&work->work);
	return;

bail_mm:
bail_mm:
	mmput(mm);
	mmput(mm);
bail:
	return;
	return;
}
}