> --- a/drivers/infiniband/hw/amso1100/c2_provider.c
 > +++ b/drivers/infiniband/hw/amso1100/c2_provider.c
 > @@ -851,6 +851,10 @@ int c2_register_device(struct c2_dev *dev)
 >      dev->ibdev.post_recv = c2_post_receive;
 >  
 >      dev->ibdev.iwcm = kmalloc(sizeof(*dev->ibdev.iwcm), GFP_KERNEL);
 > +    if (dev->ibdev.iwcm == NULL) {
 > +            ret = -ENOMEM;
 > +            goto out1;
 > +    }
 >      dev->ibdev.iwcm->add_ref = c2_add_ref;
 >      dev->ibdev.iwcm->rem_ref = c2_rem_ref;
 >      dev->ibdev.iwcm->get_qp = c2_get_qp;

Looks like a real fix to me -- but then don't we need to kfree() this
memory if any of the later initialization fails (to avoid a leak)?
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to