Commit 92d499d991ec4f5cbd00d6f33967eab9d3ee8d6c

Authored by Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/ehca: Fix static rate if path faster than link
  IPoIB: Fix oops if xmit is called when priv->broadcast is NULL

Showing 2 changed files Side-by-side Diff

drivers/infiniband/hw/ehca/ehca_av.c
... ... @@ -76,8 +76,12 @@
76 76  
77 77 link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;
78 78  
79   - /* IPD = round((link / path) - 1) */
80   - *ipd = ((link + (path >> 1)) / path) - 1;
  79 + if (path >= link)
  80 + /* no need to throttle if path faster than link */
  81 + *ipd = 0;
  82 + else
  83 + /* IPD = round((link / path) - 1) */
  84 + *ipd = ((link + (path >> 1)) / path) - 1;
81 85  
82 86 return 0;
83 87 }
drivers/infiniband/ulp/ipoib/ipoib_main.c
... ... @@ -460,6 +460,9 @@
460 460 struct ipoib_dev_priv *priv = netdev_priv(dev);
461 461 struct ipoib_path *path;
462 462  
  463 + if (!priv->broadcast)
  464 + return NULL;
  465 +
463 466 path = kzalloc(sizeof *path, GFP_ATOMIC);
464 467 if (!path)
465 468 return NULL;