[dpdk-dev] [PATCH 1/2] rte_ethdev: fix crash if malloc fails in rte_eth_dev_callback_register

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Jul 22 15:54:07 CEST 2015


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.


More information about the dev mailing list