From patchwork Wed Jul 29 12:05:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Vadai X-Patchwork-Id: 501681 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BB80214030B for ; Wed, 29 Jul 2015 22:06:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbbG2MG3 (ORCPT ); Wed, 29 Jul 2015 08:06:29 -0400 Received: from [193.47.165.129] ([193.47.165.129]:53794 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750898AbbG2MG2 (ORCPT ); Wed, 29 Jul 2015 08:06:28 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from amirv@mellanox.com) with ESMTPS (AES256-SHA encrypted); 29 Jul 2015 15:05:59 +0300 Received: from swl095.mtl.labs.mlnx (swl095.mtl.labs.mlnx [10.7.17.95]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t6TC5xbX018465; Wed, 29 Jul 2015 15:05:59 +0300 From: Amir Vadai To: "David S. Miller" Cc: netdev@vger.kernel.org, Or Gerlitz , Achiad Shochat , Tal Alon , Haggai Abramonvsky , Saeed Mahameed , Amir Vadai Subject: [PATCH net-next 1/8] net/mlx5_core: Check the return value of mlx5_command_exec() Date: Wed, 29 Jul 2015 15:05:39 +0300 Message-Id: <1438171546-17021-2-git-send-email-amirv@mellanox.com> X-Mailer: git-send-email 2.4.3.413.ga5fe668 In-Reply-To: <1438171546-17021-1-git-send-email-amirv@mellanox.com> References: <1438171546-17021-1-git-send-email-amirv@mellanox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Haggai Abramonvsky mlx5_cmd_exec() might fail - need to check return value. Signed-off-by: Haggai Abramovsky Signed-off-by: Saeed Mahameed Signed-off-by: Amir Vadai --- drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h index fc88eca..566a704 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h @@ -73,7 +73,12 @@ static inline int mlx5_cmd_exec_check_status(struct mlx5_core_dev *dev, u32 *in, int in_size, u32 *out, int out_size) { - mlx5_cmd_exec(dev, in, in_size, out, out_size); + int err; + + err = mlx5_cmd_exec(dev, in, in_size, out, out_size); + if (err) + return err; + return mlx5_cmd_status_to_err((struct mlx5_outbox_hdr *)out); }