Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbdHRQCQ (ORCPT ); Fri, 18 Aug 2017 12:02:16 -0400 Received: from mail-db5eur01on0059.outbound.protection.outlook.com ([104.47.2.59]:23680 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751706AbdHRQCN (ORCPT ); Fri, 18 Aug 2017 12:02:13 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonro@mellanox.com; Date: Fri, 18 Aug 2017 19:02:02 +0300 From: Leon Romanovsky To: Colin King Cc: Saeed Mahameed , Matan Barak , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mlx5: ensure 0 is returned when vport is zero Message-ID: <20170818160202.GA18138@mtr-leonro.local> References: <20170818134925.16604-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <20170818134925.16604-1-colin.king@canonical.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [213.57.247.46] X-ClientProxiedBy: VI1P190CA0035.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::48) To VI1PR0501MB1936.eurprd05.prod.outlook.com (2a01:111:e400:7b79::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c5d48b2-7d68-4580-abd1-08d4e6527a31 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR0501MB1936; X-Microsoft-Exchange-Diagn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MFwChpo1G7badl04oX7bP0SrA0/9fBkVUGubi8hQ+Zx+WrBAAgav6oBlKxMtK0c18NlkU/36v5SjqRfY3Os2s5Agi8sjlLMnpdUmLI1hdQPcNYENRHO38X5VUIGZqtNLUAyC8RfA+vIU8At17SI/TzRn+3Oi6h3Jpq4DoebdiW9Amk3j8QPpEAAVzh9ksqpInp9Nms0oGp3zUNLJWHfz9nt7/q7RZHkFmqmvXbxD47WVU4YCSDxTPQxuFYJsy3G1kCIVVhh+Pnv+Df4KHat5j9G/ltayPiPAwLGkJG6tPdpNVIcJPk87Wv0ITLy49wGdTCc/xunRAg9KhUOr17tBmVg9pPH/DJ76/RtE27sJD;4:ow3d4EKT6in7KOhcL1nV43r0u5s2zWmmZwQZn/Jg40tRJmo2Iu+F60IfuK0/HsUA2LikDvdj6d7HXeTi6FXs9fBN95LdKhcKS/K6HbWehPyWiXf4tqdwNL+oBEcbqUxtDDBX7nLkf0y+DAajsZz+qIUwfghhO4XwuKQ+l5FSbnF9/w5W1RBiZOLvRl025+X19fiP5hUdBSDoQOS8inwWD0+6jKSk0aXsBzB6a64KHm/muVhe5KvagG2UsSxJZT/pQmU+eKRmGJ8OU6Ej/NdrmNlB3X7tBT/sH6W7CZpwCPU= X-Exchange-Antispam-Report-Test: UriScan:(198206253151910); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0501MB1936;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0501MB1936; X-Forefront-PRVS: 040359335D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6069001)(6009001)(39860400002)(24454002)(189002)(199003)(1076002)(4001350100001)(50986999)(54356999)(189998001)(66066001)(76176999)(81156014)(81166006)(8676002)(105586002)(305945005)(4326008)(97736004)(3846002)(7736002)(6116002)(42186005)(106356001)(6486002)(33656002)(98436002)(6666003)(7350300001)(21480400003)(76506005)(229853002)(101416001)(68736007)(2950100002)(2906002)(6916009)(6496005)(25786009)(6246003)(84326002)(54906002)(575784001)(9686003)(86362001)(110136004)(478600001)(53936002)(5660300001)(83506001)(18370500001)(2700100001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0501MB1936;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:3;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0501MB1936;23:dwunGp0y3JgSd2wzckSq+nC8oQL4grcWN38oyA3?= =?us-ascii?Q?U6GIVTs1Kpa+VpcWevSXK00hI/DoifFSTkJWhpmEjsB57lr0Dhnoq214TlYx?= =?us-ascii?Q?taOQB9Hfj/m7EDaWadbIx3U8O6Ed4lxs+ocBkSwt4qOwWTGewEvW0bT0fwE+?= =?us-ascii?Q?5O974t1J73Qhe4cS+xyhsHcQhkCnS9GBhwBTg0PZwQr2q4R0JfQlztHHb9VZ?= =?us-ascii?Q?oH3Q8UxfEu/wP6ClZvajoxTxSz/1DNfqXAJfgf82GRxrp5DWJfbIPLfNrdwW?= =?us-ascii?Q?6zseEwHfaCYZR4+M0wiIPc1AqCW1PraXxvP3dRdM+PIF0LJGnBmByVXz8qj9?= =?us-ascii?Q?YWPEoC1z9cRcWvNYJEkY85LRBjKQE3fIyHZIJlm3OTnc8HfvHpjTnLf2dcsT?= =?us-ascii?Q?ZdWy3S1VFhUxNZtDffFjdpmtlUyYJ80SNVuIQCdhhIf9O3gkvjDe4q2FjH7W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NTGLVNKs0ZKeIa?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0501MB1936;6:wIqVRvXGIXWocwXT773inwc/qZ2qlNvey2Zqqy7q3duG/S3RA0to66wrakKFPsSrZbowXg1Q4vmvKRpkJPYDtXZ+lHFHOGziDqogqkUC+bnoFh4R7+Tcm52rtYcXFDV+B5Y0AosOhyUlgZ/fX+YKuG1CKP16ZE4b2ZExaxgz94Rb92jcvHIFTX4Jo6HBKOHoEasXXTmoBRm4vB7NkJZSb1sm215krtfeZI5LzTFjYdUsOfXUVq3tdGJr0UtSp+6O+fJEin7keM0lGDWGKf3KfNV218ZT/6G9ZlcmW+3gdO/rX47BL7p5NUSYaT5R80OID3bO67WEly9RInuybZ6VzA==;5:/Kk8vHLw6BtrJlhhfiJgvJ9lbpokwnpFxvrqmGjRCYcomvtV9dmZjuq0/tyJOatBJFN/cIsJ+odN+Q5+S3BG2ZzOxWFDPRU5PiR4ksnqLWMN6Tz04cfNQjNyKafLHSdvuFd8eO3BKaJn3SzZTFQydA==;24:V1Js7sLpKrJjKTBEAgmNeIFx9E4KVNRkzECjhQzasxLZFsX/fEWaWrM0koMymmOQoE51IsaaJxDveDMABPkCAu+8/UH6rRJQ8iQ/UBwXe0E=;7:4UTNTQcov/jGXX/KzT+1ogr/63E+Nh3ZXc2lC3Xddg90SMXXXrg0ldepuVDC+E9Ig9RKzO59M6tFdzHqS8efNznhMxInJvU+QwLKcfHpDTd/BdmhYYGKQONT56Vbawye2jT6hucWnaJ2hw4HnWFAPYWmcyLgD2nWmeARb8ZxpFv7eSGwDFwzSVxuIHQOE1bIPy3vWRnGbNmBvWZHrxfwaR+1BH0e+SMcnyrOlzJo84Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2017 16:02:07.5052 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB1936 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2414 Lines: 61 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Aug 18, 2017 at 02:49:25PM +0100, Colin King wrote: > From: Colin Ian King > > Currently, if vport is zero then then an uninialized return status > in err is returned. Since the only return status at the end of the > function esw_add_uc_addr is zero for the current set of return paths > we may as well just return 0 rather than err to fix this issue. > > Detected by CoverityScan, CID#1452698 ("Uninitialized scalar variable") > > Fixes: eeb66cdb6826 ("net/mlx5: Separate between E-Switch and MPFS") > Signed-off-by: Colin Ian King > --- > drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c > index 6d9fb6ac6e9b..c77f4c0c7769 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c > @@ -401,7 +401,7 @@ static int esw_add_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr) > esw_debug(esw->dev, "\tADDED UC MAC: vport[%d] %pM fr(%p)\n", > vport, mac, vaddr->flow_rule); > > - return err; > + return 0; > } > I personally prefer initialization of "err" to zero, but this solution is fine enough too. Thanks, Reviewed-by: Leon Romanovsky --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAlmXD3kACgkQ5GN7iDZy WKdWmA//e9TDx4qVnGhvtQKD7/eiMbFxr1Dq7g+2NgUZi68JxVNtAEfoErH7Yls2 RxzkZ3i7+q9G7dgWvPkuL6xBy5e8/ycXWGDhqQpzgV5vI/dsFlSsaX7UR9iXSfmt 3bo1wJCrrZ9DNJ/fGzpDHAccv59zXj4fIwHFva9/mbJZnJxERb6IFVNEGkq2ncG7 /iE4TecM4nLm0hSh+rjVPu5LGv5hAvrgw5WWRo0Yi2Wxr79B23D2OmrJywxy4fN5 5bcZ6VddRKneupESMGgaRxJMt+tcAD6YrwC/m+wV4N9lbb1tLq4Ubnl6aFDOkSvB W+kZZdwBGg5NP+9sxQPcgXI5CXt9qDILcGfRGH4Dl//v4KjGk+nOHBrv/a9BsgmE ASM0lmPIfRdKN7X8t3hs+FEO8VqW8jsyHr+IHWiE3ugwok2y0T2UzaitDVF67PKM yeoFrrLaWybSDuuviRXfYHsm0pLnudhlnAo+UHCPjN7TywyBG/CJNGdbRRveFD4n YBSNp8O266tbOsxwmZQkHszp0MKzwVF5zXP8VJFI+7YSi02KJaF9aZ9FeJsC+wxZ oL2iCwTBDwHNiOIP70uW1DPrlEziaNlTCgCCu3Ps2KbDYqjSWUk+z/TuLO5FpF3t YM2Jd6Rd6+IOa9W8d6NFwWaMshm3/F6i4fGKKCCspTtsmo3gIRM= =D2UC -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--