Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757377AbbDPMzq (ORCPT ); Thu, 16 Apr 2015 08:55:46 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:33249 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752367AbbDPMzi (ORCPT ); Thu, 16 Apr 2015 08:55:38 -0400 Message-ID: <552FB147.8060407@profitbricks.com> Date: Thu, 16 Apr 2015 14:55:35 +0200 From: Michael Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Hal Rosenstock CC: Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , Or Gerlitz , Haggai Eran , Ira Weiny , Tom Talpey , Jason Gunthorpe , Doug Ledford Subject: Re: [PATCH v4 04/27] IB/Verbs: Reform IB-core cm References: <552F6CF2.4000606@profitbricks.com> <552F6D67.1070509@profitbricks.com> <552FAE87.50303@dev.mellanox.co.il> In-Reply-To: <552FAE87.50303@dev.mellanox.co.il> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1609 Lines: 58 On 04/16/2015 02:43 PM, Hal Rosenstock wrote: [snip] >> + >> + count++; >> } >> + >> + if (!count) { >> + device_unregister(cm_dev->device); >> + kfree(cm_dev); >> + return; > > Nit: alternatively, this could be goto at end of this routine where > there is same 2 calls. I think Jason made this comment on earlier set of > these patches. Thanks for the notify, I guess I missed it, my bad :-P Will be "goto free" in next version. Regards, Michael Wang > > -- Hal > >> + } >> + >> ib_set_client_data(ib_device, &cm_client, cm_dev); >> >> write_lock_irqsave(&cm.device_lock, flags); >> @@ -3825,6 +3835,9 @@ error1: >> port_modify.set_port_cap_mask = 0; >> port_modify.clr_port_cap_mask = IB_PORT_CM_SUP; >> while (--i) { >> + if (!rdma_ib_or_iboe(ib_device, i)) >> + continue; >> + >> port = cm_dev->port[i-1]; >> ib_modify_port(ib_device, port->port_num, 0, &port_modify); >> ib_unregister_mad_agent(port->mad_agent); >> @@ -3853,6 +3866,9 @@ static void cm_remove_one(struct ib_device *ib_device) >> write_unlock_irqrestore(&cm.device_lock, flags); >> >> for (i = 1; i <= ib_device->phys_port_cnt; i++) { >> + if (!rdma_ib_or_iboe(ib_device, i)) >> + continue; >> + >> port = cm_dev->port[i-1]; >> ib_modify_port(ib_device, port->port_num, 0, &port_modify); >> ib_unregister_mad_agent(port->mad_agent); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/