Skip to content

Commit

Permalink
ntb: stop link work when we do not have memory
Browse files Browse the repository at this point in the history
Instead of keep trying to go through the init routine when we aren't able
to allocate memory, we should just stop and go down.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
  • Loading branch information
Dave Jiang authored and Jon Mason committed Mar 18, 2016
1 parent e902133 commit 84f7668
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/ntb/ntb_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static void ntb_transport_link_work(struct work_struct *work)
struct pci_dev *pdev = ndev->pdev;
resource_size_t size;
u32 val;
int rc, i, spad;
int rc = 0, i, spad;

/* send the local info, in the opposite order of the way we read it */
for (i = 0; i < nt->mw_count; i++) {
Expand Down Expand Up @@ -899,6 +899,13 @@ static void ntb_transport_link_work(struct work_struct *work)
out1:
for (i = 0; i < nt->mw_count; i++)
ntb_free_mw(nt, i);

/* if there's an actual failure, we should just bail */
if (rc < 0) {
ntb_link_disable(ndev);
return;
}

out:
if (ntb_link_is_up(ndev, NULL, NULL) == 1)
schedule_delayed_work(&nt->link_work,
Expand Down

0 comments on commit 84f7668

Please sign in to comment.