From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John Daley (johndale)" Subject: Re: [RFC 2/4] enic: fix assignment Date: Tue, 10 Oct 2017 17:31:16 +0000 Message-ID: References: <20170926185329.2776-1-aconole@redhat.com> <20170926185329.2776-3-aconole@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: Aaron Conole , "dev@dpdk.org" Return-path: Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by dpdk.org (Postfix) with ESMTP id 77CA11B30D for ; Tue, 10 Oct 2017 19:31:18 +0200 (CEST) In-Reply-To: <20170926185329.2776-3-aconole@redhat.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Aaron, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Aaron Conole > Sent: Tuesday, September 26, 2017 11:53 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [RFC 2/4] enic: fix assignment >=20 > As it stands, the existing assingment to mbuf has no effect outside of th= e > function. Prior to this change, the mbuf argument would contain an inval= id > address, but it would not be null. After this change, the caller gets a = null > mbuf back. >=20 > Signed-off-by: Aaron Conole > --- > drivers/net/enic/enic_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c > index 40dbec7..ff8e4c5 100644 > --- a/drivers/net/enic/enic_main.c > +++ b/drivers/net/enic/enic_main.c > @@ -224,7 +224,7 @@ enic_free_rq_buf(struct rte_mbuf **mbuf) > return; >=20 > rte_pktmbuf_free(*mbuf); > - mbuf =3D NULL; > + *mbuf =3D NULL; > } >=20 > void enic_init_vnic_resources(struct enic *enic) As it turns out, this function is only called when the device is stopped an= d restarting the device overwrites the mbuf pointers with newly allocated o= nes, so there is currently no bad behavior. The intent was to NULL out the = pointer though and it's certainly better form so I agree with the change. Reviewed-by: John Daley Thanks, Johnd > -- > 2.9.5