Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751347AbcLDKYb (ORCPT ); Sun, 4 Dec 2016 05:24:31 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35294 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbcLDKY2 (ORCPT ); Sun, 4 Dec 2016 05:24:28 -0500 Subject: Re: [PATCH 1/1] net: bnx2x: fix improper return value To: Pan Bian , Michal Kalderon , Yuval Mintz , Ariel Elior , everest-linux-l2@cavium.com, netdev@vger.kernel.org References: <1480840746-7498-1-git-send-email-bianpan201604@163.com> Cc: linux-kernel@vger.kernel.org, Pan Bian From: Sergei Shtylyov Message-ID: <3bd7d66c-bfcb-f462-cacd-f211170c12f5@cogentembedded.com> Date: Sun, 4 Dec 2016 13:24:25 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1480840746-7498-1-git-send-email-bianpan201604@163.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 660 Lines: 20 On 12/4/2016 11:39 AM, Pan Bian wrote: > From: Pan Bian > > Marco BNX2X_ALLOC_AND_SET(arr, lbl, func) calls kmalloc() to allocate Macro. > memory, and jumps to label "lbl" if the allocation fails. Label "lbl" > first cleans memory and then returns variable rc. Before calling the > macro, the value of variable rc is 0. Because 0 means no error, the > callers of bnx2x_init_firmware() may be misled. This patch fixes the bug, > assigning "-ENOMEM" to rc before calling macro NX2X_ALLOC_AND_SET(). > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189141 > > Signed-off-by: Pan Bian [...] MBR, Sergei