From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 1/2] rte_ethdev: fix crash if malloc fails in rte_eth_dev_callback_register Date: Wed, 22 Jul 2015 15:54:07 +0200 Message-ID: <3213032.xsSQnWmWTv@xps13> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Stephen Hemminger 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) In-Reply-To: <20150717081603.GB11996@bricha3-MOBL3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.