Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751070AbcLDLdQ (ORCPT ); Sun, 4 Dec 2016 06:33:16 -0500 Received: from mail-sn1nam01on0077.outbound.protection.outlook.com ([104.47.32.77]:40208 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750697AbcLDLdO (ORCPT ); Sun, 4 Dec 2016 06:33:14 -0500 X-Greylist: delayed 10892 seconds by postgrey-1.27 at vger.kernel.org; Sun, 04 Dec 2016 06:33:14 EST From: "Kalderon, Michal" To: Pan Bian , "Mintz, Yuval" , "Elior, Ariel" , "netdev@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" , Pan Bian Subject: RE: [PATCH 1/1] net: ethernet: broadcom: fix improper return value Thread-Topic: [PATCH 1/1] net: ethernet: broadcom: fix improper return value Thread-Index: AQHSTffJ9TyJ+qKdzUGwDO3E+gCkx6D3a/Og Date: Sun, 4 Dec 2016 07:59:10 +0000 Message-ID: References: <1480832969-5888-1-git-send-email-bianpan201604@163.com> In-Reply-To: <1480832969-5888-1-git-send-email-bianpan201604@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michal.Kalderon@cavium.com; x-originating-ip: [31.168.140.228] x-microsoft-exchange-diagnostics: 1;BL2PR07MB2306;7:IxtiCyhx/BFxzVJXWzdr3yU+C8r7K5znA5YrKNbWQb9W1z7pC+tAGz1CaJtD+vcjevQ/UmxhIGuB34Fmkj2WCKRDLvJNd8AbBKvu2zFqjaFoAMW4BNdaiQVxesPlUv6muOK+j2MkRBd5ILg289TDzz7KvPdWe8R4/ZzoBl/JMcNatA0D4fYXkvnIifRFoQ9sVjlYcz5eU3rTSDjTvKgt4iWy51sDSvpA7D6XMF7IIghpFrlwsyrF99cJ513GJCX44ldjWdVYWJCQq+mdDNe2XYgyJHgaQJbzuExB4gAF/APMkSXeY1I4Jg0WllR9UeDSzya3HyO+KdBK3bp7B5ID67MDWSrxqqF7mhc5yKexGpp+dzwd5qcwb3ZuicnSht/yoLcwkV5fIekZFlDgIiR6o4cE9KSyVED95iugeRZ19XxR+5ocBmY9OufkWPyyYe0j6G7YEsrEWS32Qo9Xpac0Bg== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(7916002)(199003)(189002)(8676002)(81156014)(97736004)(5001770100001)(81166006)(9686002)(8936002)(76576001)(105586002)(106116001)(106356001)(99286002)(7736002)(39450400002)(3660700001)(77096006)(3280700002)(122556002)(2950100002)(54356999)(76176999)(50986999)(6116002)(68736007)(102836003)(2501003)(38730400001)(229853002)(7696004)(39410400001)(92566002)(74316002)(3846002)(2900100001)(86362001)(305945005)(33656002)(66066001)(189998001)(7846002)(6506006)(5660300001)(101416001)(4326007)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR07MB2306;H:SN1PR0701MB1933.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: 0383fca6-90fa-49a0-aac9-08d41c1b6e80 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BL2PR07MB2306; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(130843839470238); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:BL2PR07MB2306;BCL:0;PCL:0;RULEID:;SRVR:BL2PR07MB2306; x-forefront-prvs: 014617085B spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2016 07:59:10.6890 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR07MB2306 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uB4BXLft005263 Content-Length: 739 Lines: 16 > From: Pan Bian > > Marco BNX2X_ALLOC_AND_SET(arr, lbl, func) calls kmalloc() to allocate > 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 The title is wrong from net-next; It should have been "bnx2x: Fix improper return value". Acked-by: Michal Kalderon