Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754277AbdFNCz7 (ORCPT ); Tue, 13 Jun 2017 22:55:59 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:48673 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753912AbdFNCz6 (ORCPT ); Tue, 13 Jun 2017 22:55:58 -0400 Date: Wed, 14 Jun 2017 04:55:52 +0200 From: Andrew Lunn To: Salil Mehta Cc: davem@davemloft.net, yisen.zhuang@huawei.com, huangdaode@hisilicon.com, lipeng321@huawei.com, mehta.salil.lnk@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com Subject: Re: [PATCH V2 net-next 6/8] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Message-ID: <20170614025552.GC16215@lunn.ch> References: <20170613231035.494020-1-salil.mehta@huawei.com> <20170613231035.494020-7-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170613231035.494020-7-salil.mehta@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 324 Lines: 11 > + if (le16_to_cpu(HCLGE_MDIO_STA_VAL(mdio_cmd->sta))) { > + dev_err(&hdev->pdev->dev, "mdio read data error\n"); > + return -ENOMEM; > + } If it is not zero, it is an error. !0 is always !0, big or little endian, so there is no point doing the le16_to_cpu(). Where is the memory allocation which failed? Andrew