From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73443A054F; Mon, 15 Mar 2021 16:39:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 552CB4068C; Mon, 15 Mar 2021 16:39:06 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id CD0D04068B for ; Mon, 15 Mar 2021 16:39:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615822744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EVn8uhxznFgY07AM4bn97SK1K4oU/sBznO7N+huHZIE=; b=KaU7y0YBayU+NVLG6MSb4Oucub76TCE7oMZDS/fBdjrTOphwD+3DyGkcfqfDLQKvoexYpU kz4XvnqjRImTUEUyY6DemIN4Na28pqKjF+xgajgP4TKrx/9ZoeHR0mZACQfox+ZZxKJ6U6 lfmtcJ6YR59illy5ZsVdRbfcQOWPHuk= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-jNuFLPqANL2WDYrAIeKSVA-1; Mon, 15 Mar 2021 11:39:02 -0400 X-MC-Unique: jNuFLPqANL2WDYrAIeKSVA-1 Received: by mail-vk1-f200.google.com with SMTP id s69so9176407vkd.20 for ; Mon, 15 Mar 2021 08:39:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EVn8uhxznFgY07AM4bn97SK1K4oU/sBznO7N+huHZIE=; b=ttqFIjtDK/0j/hbUqIRSEDyoLJLlPkHiEt5849L2iDwQZxVXJnG/19qrWMVoVgBm+V M0Whl3JUns7reaQ7oh2z/NDA7GG8rxPSgpUNhVDagA1xkF+k5FUSCpIn3ilpn1RSVlgP c+RYeN66EVw4aigA25y1BeCmaVPEFGJIa+dz+l+QNye0LiJg8SRWWPyLdNdJ04FmDkIE TCbyhbYG/EhKrLzVCgvmbzKItXkCObHeA6ZIiIfKWej3ms0nL1JvjeYJTfNa6bNZTVcK 31ej+e4r0a/0G8ArA1oUbtPD3RRXObRFlyW28NsJGak00IruFOTuDyWBoxw/fVxRZYuJ 2QDQ== X-Gm-Message-State: AOAM531oAKgzgDY/SgDXYrXVEtLbmFPmUOUaGCNUyXN5nY1viF5pGzxc BsP22zj1XAa6y/feEkL0rF4QrmFcybeyV9PZ58nsNm4BmGeFbuT7XSIkNBF1o9YBNVU4F1auZfm 9SpiArG3Fk7+dRpE9wqI= X-Received: by 2002:a9f:2722:: with SMTP id a31mr5227819uaa.86.1615822742122; Mon, 15 Mar 2021 08:39:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH2kG3YUKTePkt6mMebR6/bRd130u0v3O9FKzpH8KdUOeSlhWdLr3o+K1XqiWC+Xj0/zO7T/X0UEU0JXEJZl4= X-Received: by 2002:a9f:2722:: with SMTP id a31mr5227807uaa.86.1615822741883; Mon, 15 Mar 2021 08:39:01 -0700 (PDT) MIME-Version: 1.0 References: <20210315151957.360530-1-maxime.coquelin@redhat.com> <20210315151957.360530-3-maxime.coquelin@redhat.com> In-Reply-To: <20210315151957.360530-3-maxime.coquelin@redhat.com> From: David Marchand Date: Mon, 15 Mar 2021 16:38:50 +0100 Message-ID: To: Maxime Coquelin Cc: dev , "Xia, Chenbo" , Adrian Moreno Zapata , Olivier Matz , bnemeth@redhat.com Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/virtio: improve queue init error path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Mar 15, 2021 at 4:20 PM Maxime Coquelin wrote: > @@ -604,15 +604,22 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx) > > if (VIRTIO_OPS(hw)->setup_queue(hw, vq) < 0) { > PMD_INIT_LOG(ERR, "setup_queue failed"); > - return -EINVAL; > + ret = -EINVAL; > + goto clean_vq; > } > > return 0; > > -fail_q_alloc: > - rte_free(sw_ring); > +clean_vq: > + hw->cvq = NULL; > + > + if (sw_ring) > + rte_free(sw_ring); Nit: rte_free handles NULL fine, you can remove the test, the same way it was done before. > +free_hdr_mz: > rte_memzone_free(hdr_mz); > +free_mz: > rte_memzone_free(mz); > +free_vq: > rte_free(vq); > > return ret; -- David Marchand