Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3927342imm; Sun, 13 May 2018 23:21:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqmp881kSOjlmAGPawXFogbkMSUUf1hxzdZqLj3tPUEg49Bjrmjk8ECke0X9PSyRAssgB2 X-Received: by 2002:a63:be4b:: with SMTP id g11-v6mr7453256pgo.41.1526278898302; Sun, 13 May 2018 23:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526278898; cv=none; d=google.com; s=arc-20160816; b=xJkdbHvRLWsfWSWnphYHNk8HHHZL9UMIwdREp5mJKSBWkVQBdYCVUwViZtFelHLdOt dMuyPkX9d0kclPD95pHk4hjk6Xd9s/5TM/37AmUmhScAev4ya7K1tLfqPhaBpS4qhIy4 EcGMXpbauO5r0DsDbIRF6lKcoAxKXDw7wG/CgQ/FOpqt/b1wMhmomINr5jlHSpnHZab+ ws+KYkF+g3lQVYzlq3LZDhd499OiBS4np8bMu8hyRR88v2JzYzgREjU4YskPYbHmkR/5 5yXiWJLTRg8vr6BxObD1xi95qnZdyS3H3UYDKO/A587c9pEirIm7oYkJiLzbLbmxTD9Z aqVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ig1ucP02+nsTzW4xmhgO0R5bhzKcv3/SgQ4RVUI6sdw=; b=igfR0PEWFVjz1IJvxEbARFxORDPXN+K2nHJniYRDR4n+54Vh/fatL5jhCD3LLXewMG FGMQ7yiNdA2FkWWjHCJm+qcxPdteLTrsXFlAzmv/krfBQUzr8JoCr0CK/a2gz1b4q9tS 5y22BjOstnDSGfN6JmSf7dndcAXesOyh7gg9cJb0muBixePS8Wvum22g8stBK++7hYcl F35nf/EpdGUwvFDVHvnBwTz7aEtqMZplAx1fEP1lTQpjCqz7yhi+IGUJI78eLLl7FzxA tkKLY1ImijbgJLs8CBP5P7BlXbIl0eghY2yNb4oKjnh78DDQN1igHR0iMQ0g3F5GTdb8 wISA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEFyC00D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10-v6si8587837pfc.188.2018.05.13.23.21.23; Sun, 13 May 2018 23:21:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEFyC00D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752008AbeENGVN (ORCPT + 99 others); Mon, 14 May 2018 02:21:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:44264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbeENGVM (ORCPT ); Mon, 14 May 2018 02:21:12 -0400 Received: from localhost (unknown [5.29.173.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CA612172B; Mon, 14 May 2018 06:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526278871; bh=ig1ucP02+nsTzW4xmhgO0R5bhzKcv3/SgQ4RVUI6sdw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AEFyC00DYwX8e3DDVEl+CR/cS5l5mRxRZfrDXvIkcvkgR4I7QE5MmlWIvHmBMpXAK qPAhF8Eq6z78soRvME/R31iHM4n1WLpielny4t7upWE4ACqnl9wcfwM89j9+RFA8+g ZiKsaItj5B/IVCaiqr9mDeEYqJbzXm4ea126O6NA= Date: Mon, 14 May 2018 09:21:09 +0300 From: Leon Romanovsky To: Tarick Bedeir Cc: tariqt@mellanox.com, gthelen@google.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net/mlx4_core: Fix error handling in mlx4_init_port_info. Message-ID: <20180514062109.GK10381@mtr-leonro.mtl.com> References: <20180513233845.135290-1-tarick@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y1L3PTX8QE8cb2T+" Content-Disposition: inline In-Reply-To: <20180513233845.135290-1-tarick@google.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Y1L3PTX8QE8cb2T+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, May 13, 2018 at 04:38:45PM -0700, Tarick Bedeir wrote: > Avoid exiting the function with a lingering sysfs file (if the first > call to device_create_file() fails while the second succeeds), and avoid > calling devlink_port_unregister() twice. > > In other words, either mlx4_init_port_info() succeeds and returns zero, or > it fails, returns non-zero, and requires no cleanup. > > Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB > ports") Please don't break "Fixes" lines, it complicates "grep". IMHO, general cleanup exit point is needed in this function (goto ...), but your fix is good enough too. Thanks for doing it. Reviewed-by: Leon Romanovsky --Y1L3PTX8QE8cb2T+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJa+SrVAAoJEORje4g2clinP+0P/2WCHSxqo1z6MnkYwbN24ix9 hPxeRmGlfBBAIEVt54BFI248Y2pxeOpRmtct1SktOeidkR2sqfIvTwGuuUBq8Iw9 gun9qfwgWXciGYNl/VR4udy65dwcd/YuRoeYbvpvFm3/7zYKZXKoXl1vEp9CvT0t Lo2MEiaSjTUSo9wzzJBfvppeqsoI+h5vOx+zmsHjm2b3CjuikiqQ5/wBT410glx1 0EV5EY0Z0zfQROarzJViL2nn3Zeoai9VFfrVh2ujcZ9yOjF/K/GyO3ovE/h1DuhD 3GiMPEh7s1Ua1w8x1VyIf7oRZkIOSRpOvc1vclwF8sMD4eIwxtTpLs/DaaNB4lCi YU3/hOfwfL3kAne79MTaK6PJPh3zVoeBFhwlu1xIkXR5D3VbmGnzU94iU7hzRiEN 90+majc6aurhetVzUN0NxSXTaRagOZ7Ae2vmCchHxSTczNe/8e1pGNOwef4h7HH6 QKQ5OHldp10A9s1tDh+wr2xt5VZsL1GKNfRVDXH/0H4nnBOyIopOkVtVbnSNUvYr WW78FSCFIsDPRH9kcJf/XFzhusY+9Ev4z6+lJbQoRfR0uOGEMtttJfIIIgEfuW1b W4AjihHqMeacQXOXRSevTtTnmpXJZm9rGd8kDZ1BqiCJo5PH+8Vl8uMQs8L9Tim+ /8CQJ23NPZwyqyccy4xj =7qEX -----END PGP SIGNATURE----- --Y1L3PTX8QE8cb2T+--