lkml.org 
[lkml]   [2015]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib
On Mon, Apr 13, 2015 at 02:25:16PM +0200, Michael Wang wrote:
> dev_list = kmalloc(sizeof *dev_list, GFP_KERNEL);
> if (!dev_list)
> @@ -1673,13 +1671,19 @@ static void ipoib_add_one(struct ib_device *device)
> }
>
> for (p = s; p <= e; ++p) {
> - if (rdma_port_get_link_layer(device, p) != IB_LINK_LAYER_INFINIBAND)
> + if (!rdma_tech_ib(device, p))
> continue;
> dev = ipoib_add_port("ib%d", device, p);
> if (!IS_ERR(dev)) {
> priv = netdev_priv(dev);
> list_add_tail(&priv->list, dev_list);
> }
> + count++;
> + }
> +
> + if (!count) {
> + kfree(dev_list);
> + return;
> }

This doesn't quite look right, it should be 'goto error1'

But then I read 'goto error1' and it doesn't look like it can handle
cm_dev->port being NULL, so more fixing is needed.

Ditto for cm_remove_one

Should audit all uses of cm_dev->port[] to make sure they can all
handle NULL.

Jason


\
 
 \ /
  Last update: 2015-04-13 22:01    [W:0.264 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site