[LU-7979] dereferencing ERR PTR in kiblnd_alloc_freg_pool Created: 01/Apr/16 Updated: 03/Oct/16 Resolved: 11/Apr/16 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.9.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Oleg Drokin | Assignee: | Dmitry Eremin (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Severity: | 3 | ||||
| Rank (Obsolete): | 9223372036854775807 | ||||
| Description |
|
Recently landed FMR patch introduced this problem: frd->frd_frpl = ib_alloc_fast_reg_page_list(fpo->fpo_hdev->ibh_ibdev,
LNET_MAX_PAYLOAD/PAGE_SIZE);
if (IS_ERR(frd->frd_frpl)) {
rc = PTR_ERR(frd->frd_frpl);
CERROR("Failed to allocate ib_fast_reg_page_list: %d\n",
rc);
goto out_middle;
}
...
out_middle:
if (frd->frd_mr)
ib_dereg_mr(frd->frd_mr);
if (frd->frd_frpl)
ib_free_fast_reg_page_list(frd->frd_frpl);
We should be either assigning the frd_frpl NULL or expand the check at teh end, I guess. |
| Comments |
| Comment by Andreas Dilger [ 01/Apr/16 ] |
|
It would be better to just add a different label out_frd: or similar and jump to that. Also, the following case of frd_mr is the same, and it should jump just before ib_free_fast_reg_page_list() and out_middle: isn't useful at all, nor are the "if (frd->frd_*)" checks. |
| Comment by Gerrit Updater [ 04/Apr/16 ] |
|
Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/19311 |
| Comment by Gerrit Updater [ 11/Apr/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/19311/ |
| Comment by Joseph Gmitter (Inactive) [ 11/Apr/16 ] |
|
Landed to master for 2.9.0 |