From nobody Mon Feb 9 07:38:19 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=1622619544; cv=none; d=zohomail.com; s=zohoarc; b=hTluctw9/qrCt222pPIK67GTHEL+3JBKNHKlZgB3k8x9QMao/fUX7C3pMaKW9Q+7DoAm+Ry0X87h+xHlnG5ma8NQtxiKaJ0jUi2MXaqVq4MlZj0+0DuY8JnWFKYPn8ORf5lgI8yLLDxsRDuxPhgc3xRyMPI/zMz494+YK4yckWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622619544; 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=zwavbmWV2CdWHw4EU/lib5bIJAUFLLq+EeQd03SUtmE=; b=OQwlUlLg6LXpogjVNIMTTTm2K2/doAhOC6NaMzppjPZgO1m6ywfsyAFiVXzI+qL3VOR+wd12PVSq9phCLXKkqejqjemtD4OewKwJ/xYgLPInPxZ9+XGzrDnzH9kjD1vj/gQv1H85IQB7Ie9942KzwG4/GZYVnOghYPTT3jNh5r4= 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) header.from= 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 1622619544894824.7744813211024; Wed, 2 Jun 2021 00:39:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515--2d-5knhOKC7fDPLTW9laQ-1; Wed, 02 Jun 2021 03:38:19 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D40511854E25; Wed, 2 Jun 2021 07:38: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 A4F9B10023B0; Wed, 2 Jun 2021 07:38: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 670A144A61; Wed, 2 Jun 2021 07:38:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1527bqI6021092 for ; Wed, 2 Jun 2021 03:37:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C9405C230; Wed, 2 Jun 2021 07:37:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTP id 204E75C648 for ; Wed, 2 Jun 2021 07:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622619543; 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=zwavbmWV2CdWHw4EU/lib5bIJAUFLLq+EeQd03SUtmE=; b=AzttJoplqsMhwxy5HPddgT32JMN//CiRwDHFXLpE7MQQfdcXfY1ep0SRqz+Hw86aSSkVis WSPJAORovmYBPtpGUgcdummj8SW+RjqGPnmLIlfh6f6ksZZPEFTEGkrveQfI2BAF5pvPvp 6umlUsFRafUro4BFRBuO01LKvyYUvLc= X-MC-Unique: -2d-5knhOKC7fDPLTW9laQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] node_device_udev: Don't overwrite @ret in udevProcessStorage() Date: Wed, 2 Jun 2021 09:37:42 +0200 Message-Id: <580ee2994c523c9cec4f95ba77e94bfcd1c95cea.1622619418.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.84 on 10.5.11.22 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) Content-Type: text/plain; charset="utf-8" Let's use a different variable for storing retvals of helper functions. This way the usual function pattern can be restored. Signed-off-by: Michal Privoznik --- src/node_device/node_device_udev.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index f48789d98f..3c31e6cde4 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -927,6 +927,7 @@ udevProcessStorage(struct udev_device *device, { virNodeDevCapStorage *storage =3D &def->caps->data.storage; int ret =3D -1; + int rv; const char* devnode; =20 devnode =3D udev_device_get_devnode(device); @@ -971,22 +972,26 @@ udevProcessStorage(struct udev_device *device, } =20 if (STREQ(def->caps->data.storage.drive_type, "cd")) { - ret =3D udevProcessCDROM(device, def); + rv =3D udevProcessCDROM(device, def); } else if (STREQ(def->caps->data.storage.drive_type, "disk")) { - ret =3D udevProcessDisk(device, def); + rv =3D udevProcessDisk(device, def); } else if (STREQ(def->caps->data.storage.drive_type, "floppy")) { - ret =3D udevProcessFloppy(device, def); + rv =3D udevProcessFloppy(device, def); } else if (STREQ(def->caps->data.storage.drive_type, "sd")) { - ret =3D udevProcessSD(device, def); + rv =3D udevProcessSD(device, def); } else if (STREQ(def->caps->data.storage.drive_type, "dasd")) { - ret =3D udevProcessDASD(device, def); + rv =3D udevProcessDASD(device, def); } else { VIR_DEBUG("Unsupported storage type '%s'", def->caps->data.storage.drive_type); goto cleanup; } =20 + if (rv < 0) + goto cleanup; + udevGenerateDeviceName(device, def, storage->serial); + ret =3D 0; =20 cleanup: VIR_DEBUG("Storage ret=3D%d", ret); --=20 2.31.1