From patchwork Fri Nov 9 08:13:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10675497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1042513AD for ; Fri, 9 Nov 2018 08:14:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E88BF2E648 for ; Fri, 9 Nov 2018 08:14:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA20D2E691; Fri, 9 Nov 2018 08:14:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6115F2E648 for ; Fri, 9 Nov 2018 08:14:39 +0000 (UTC) Received: from localhost ([::1]:60841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL1w6-0003ZP-4l for patchwork-qemu-devel@patchwork.kernel.org; Fri, 09 Nov 2018 03:14:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL1vT-0003I4-AL for qemu-devel@nongnu.org; Fri, 09 Nov 2018 03:13:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL1vK-0003J1-Tr for qemu-devel@nongnu.org; Fri, 09 Nov 2018 03:13:57 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:38276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gL1vK-0003BN-23 for qemu-devel@nongnu.org; Fri, 09 Nov 2018 03:13:50 -0500 Received: by mail-pg1-x542.google.com with SMTP id f8-v6so540903pgq.5 for ; Fri, 09 Nov 2018 00:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=j0zNovnbdcHbQBl7mh9fZcWnm1dFXVaLjh+sJxcGdyY=; b=pb+CBA6Kn53egK6I/8LxnQN70+YP/iaAn2npba1ucvnYqaO5Ezd5mMu1gtg+u2Dvau hrvg5Ir9kfF392PW7U6mp8EHxT0r4Z/8lkCcP2eSN7D30OA1IWnbEmuz/hbCJY746Ii7 K+bncpLLNbzmfeb8hCp4SX/o3snUFos9x8TiqBoHGpM+DVlCOHUjGYIuS/WzkzlR0vJa 8xVu9TvLR4REzrGneRwnQrxmRAjtiBqARPVzYFL0cqKko30gxyE/V3dsvMyzwHTklte9 YTd0rfwIkI+p6lsHCPYshKBbYNq6umQxWK7Ajaxt+LSzzQHlyQFbudxOwefIyYdD+FQO 3fpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=j0zNovnbdcHbQBl7mh9fZcWnm1dFXVaLjh+sJxcGdyY=; b=eXvIIpif0VjLTM6BThkSwq8fbvwU8Ofh1u01e4kpCyNs+x7+dBNILVRPbfFMKLv9do wQI1MNiKBuKs3xFgwStfl7D5K7PR0G7Wm3tiXYGsamh4llhsRYNRFx6QDMEQXwxMC/pz aQ/iyup90FomaEievlVcLOzUoNFjNykuRih8++nx+K06uAJe2mSXjorFdME94qcDUr7t oMKOsMkYxqpGq2h75v1EMkNFV2JDX3KKywJoNl7uZBj2nNUEz817mG3Y2cmW9x0rUBzL mfCeD3/X9+zJfakCE52VTUO6MkJmqLs1lyS1D7hK0jgUjMSmKTEm1sOWDbX8+hgS23mj yu0g== X-Gm-Message-State: AGRZ1gIKLsl4szGtKqnQlm/Nev56W87LEZ+Awm89T8LFL4UbDycPQXXu WX4f++XO8h2f9inQ9cVw1og= X-Google-Smtp-Source: AJdET5dnTV2I2a6c7MbWN/FuxGGpcqRwHI6keLpXraN8xuJavP+8d7KQxh2DU4GCIlDwc3YU6udKEg== X-Received: by 2002:a62:6143:: with SMTP id v64-v6mr8106519pfb.125.1541751219895; Fri, 09 Nov 2018 00:13:39 -0800 (PST) Received: from localhost.localdomain.localdomain ([103.129.255.252]) by smtp.gmail.com with ESMTPSA id 196-v6sm17831228pfc.71.2018.11.09.00.13.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 00:13:39 -0800 (PST) From: Li Qiang To: stefanha@redhat.com, marcandre.lureau@redhat.com, lvivier@redhat.com, thuth@redhat.com Date: Fri, 9 Nov 2018 00:13:34 -0800 Message-Id: <1541751214-17515-1-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [PATCH] hw: set_netdev: remove useless code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In set_netdev(), the peers[i] is initialized qemu_find_net_clients_except() when i is in 0 between 'queues' it can't be NULL. Signed-off-by: Li Qiang Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth Reviewed-by: Paolo Bonzini --- hw/core/qdev-properties-system.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 8b22fb5..b45a7ef 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -288,10 +288,6 @@ static void set_netdev(Object *obj, Visitor *v, const char *name, } for (i = 0; i < queues; i++) { - if (peers[i] == NULL) { - err = -ENOENT; - goto out; - } if (peers[i]->peer) { err = -EEXIST;