From nobody Tue Feb 10 05:27:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1643018909; cv=none; d=zohomail.com; s=zohoarc; b=cdA5ZJQ7CjMZTUL6Xd6sqkRkjvfEezHOg/gTU9fzXYejP1LDcg5V8pRfA+VP0rWRYWNyQrb+UkpAmY/ysTWhLVPRRWaQxYGRQ0vn7fQlA7PXB3jP6etKz2KUQ3yDd4QvxhT5mzV0CxaDSREuNckABZzGitVcE/fmqKFF0mIvE8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643018909; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1/keO1E8qPvWs0f1uKn9Nv5oMpJBOYaUDwqHJvFN6Lw=; b=RMdGNNgFnza+pV5THqROZlp86dciRxfQjV8QCFCRRw+dblf4xAKHsssRsy+LGwGU0ioTcnfENCdAPz/D6fe6zkrpBoaWL1qkRUyBt2mEMUdwpFtukv4c/v6xpVrXb8TwCf5XbwJqGwFtxk63RSQD08FD7fg5yWGTYj3Z+f/+4xQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1643018909960868.4062291667467; Mon, 24 Jan 2022 02:08:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-rtKCpEfoNJWmLbgxLuyd0w-1; Mon, 24 Jan 2022 05:08:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2BD731091DA1; Mon, 24 Jan 2022 10:08:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E2F260C45; Mon, 24 Jan 2022 10:08:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D46104CA9B; Mon, 24 Jan 2022 10:08:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20OA7tkL021081 for ; Mon, 24 Jan 2022 05:07:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id DA4456D03D; Mon, 24 Jan 2022 10:07:55 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CAEC6F120 for ; Mon, 24 Jan 2022 10:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643018909; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1/keO1E8qPvWs0f1uKn9Nv5oMpJBOYaUDwqHJvFN6Lw=; b=fHgQiEji3sG6eewVZz4u+VtSxgr88wS9l5PejomtK5br0I1WWHxgX0q3UJ7sLeqNUy/p+a /UpWNWTVwvwKlxaWRydcwuvfZh2II1SKHHg6fNNVbIt+urHj09RiME0wQkvj/M+TY2KUTF rNp2HvZHErLtxQ5S/XRd1iIOTK3os3A= X-MC-Unique: rtKCpEfoNJWmLbgxLuyd0w-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 03/11] virDomainChrSourceDefCopy: Don't check arguments against NULL Date: Mon, 24 Jan 2022 11:07:25 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643018911910100003 Content-Type: text/plain; charset="utf-8" The only caller of this function (qemuProcessFindCharDevicePTYsMonitor()) doesn't pass NULL. Remove corresponding check from virDomainChrSourceDefCopy(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 3 --- src/conf/domain_conf.h | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5387cd271a..e4abe1854f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2738,9 +2738,6 @@ int virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, virDomainChrSourceDef *src) { - if (!dest || !src) - return -1; - virDomainChrSourceDefClear(dest); =20 dest->type =3D src->type; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3e63d2513b..9bf54eee48 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3348,7 +3348,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSmartcardDef, = virDomainSmartcardDefFree); void virDomainChrDefFree(virDomainChrDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainChrDef, virDomainChrDefFree); int virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, - virDomainChrSourceDef *src); + virDomainChrSourceDef *src) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void virDomainSoundCodecDefFree(virDomainSoundCodecDef *def); ssize_t virDomainSoundDefFind(const virDomainDef *def, const virDomainSoundDef *sound); --=20 2.34.1