From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by dpdk.org (Postfix) with ESMTP id AF99D594B for ; Wed, 22 Jul 2015 15:55:20 +0200 (CEST) Received: by wibud3 with SMTP id ud3so155353117wib.1 for ; Wed, 22 Jul 2015 06:55:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=vfNclS/C2B/6kaflP7J5mgnNmCD6XJ2Yyne75hLA5g4=; b=XCkMVv49FGUQHcM4iHobtVFg8MuMF87KfYIe1q8ahw9tPdqJHCjAEeydqRrI1P49HS X6t/LweWq6/W3HPzyCLNGx3s/TOlg/XxPqs4IaJVGZxn7Bc20IaHgZeTp8eMy6G/82e7 IinBUsiZ82bVe+zIG8o7yUgMtdjSZadZVGLjOdaUTe3N3hr27rpivCOBaCQiCUm0Sfin W90i6rnidhU4MHudmvmKfobj3lLHzu0rnO2YDnHRVpUPmaJKJc971l3Vs6PwtXpjdvbX /F/gNbhlMduxSJAFId37ca8KcXGZ19+C/pBDIBoUlXHKBL5X9yeIPM1fHEgJzDtaqcBg 97jQ== X-Gm-Message-State: ALoCoQnsqK0Zw0yv1FVgs2Ckgjv4xNuUdxl1T5bXGkP6DJRHc7f3nUCi9y7FyoXXqRVKP82T+ttf X-Received: by 10.180.76.202 with SMTP id m10mr6881986wiw.63.1437573320501; Wed, 22 Jul 2015 06:55:20 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id ht9sm3536727wib.18.2015.07.22.06.55.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 06:55:19 -0700 (PDT) From: Thomas Monjalon To: Stephen Hemminger Date: Wed, 22 Jul 2015 15:54:07 +0200 Message-ID: <3213032.xsSQnWmWTv@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <20150717081603.GB11996@bricha3-MOBL3> References: <1437090444-24953-1-git-send-email-stephen@networkplumber.org> <1437090444-24953-2-git-send-email-stephen@networkplumber.org> <20150717081603.GB11996@bricha3-MOBL3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: fix crash if malloc fails in rte_eth_dev_callback_register X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 13:55:20 -0000 2015-07-17 09:16, Bruce Richardson: > On Thu, Jul 16, 2015 at 04:47:23PM -0700, Stephen Hemminger wrote: > > - if (user_cb == NULL && > > - (user_cb = rte_zmalloc("INTR_USER_CALLBACK", > > - sizeof(struct rte_eth_dev_callback), 0))) { > > + if (!user_cb) > > Minor style issue. Since user_cb is a pointer, not a boolean, the condition > should use "== NULL" rather than "!". Fixed before pushing.