From patchwork Mon Apr 13 08:34:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cedric Hombourger X-Patchwork-Id: 1269744 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::837; helo=mail-qt1-x837.google.com; envelope-from=swupdate+bncbdq3rtfxvmlbbi6i2d2akgqe73bsksy@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=top8hDiZ; dkim-atps=neutral Received: from mail-qt1-x837.google.com (mail-qt1-x837.google.com [IPv6:2607:f8b0:4864:20::837]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49123r5SVrz9sSY for ; Mon, 13 Apr 2020 18:34:47 +1000 (AEST) Received: by mail-qt1-x837.google.com with SMTP id q57sf4154704qte.3 for ; Mon, 13 Apr 2020 01:34:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586766883; cv=pass; d=google.com; s=arc-20160816; b=EUiq3aXm6aeg/tKIZOWa98mQmq8faTOvC+fETHrdufrzAfS7WP/PRvEtN/eW2yO6Vq sacxzBFa3f+cub8pwpirdEdyrQvkKxl+GhhzWDmGveBnmz/2nF17y+Q+5753/O7Jgb1q OwzJtJfb0vGmTsgsFjjlhC5XuR0LZ5j143mY41xdLzO5GNjkJpIN9y3RxZZCkAbY19y1 nu3kEYdtNGhmNBKHzUxHp+D28o86EjZb0pfU9SwjGvFQp2f41K4FCso50sswxKTyZuJq xK6fXE8Ms/jnd8xzqZTqYCBrCHJt68yltG0we4S/GkDTaFG0ZkA9PT/l/+6vJk6qNuD8 GXxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr:sender:dkim-signature; bh=1utpQ0yJqtsDqBEyyfPbUT4SYzv7GLmM1OwsCx0o8h0=; b=XOfOiwknDIZGFPpWNlxFp61mGqU9+2O4T7oNHotU7wbc6eyaaa1/j6Vya5qr1sCPXo isNfAzk7wlSZmsmIB0k6jsuiJFBoait5zQ39Ng9RooOoxOIrpsIBBrSfOVTGhe/Qt2Os MnwBEJl5J+tuh2FStQZF5lYDjLtiDL3s9PF92umrAZtru/fY2TyZE4FEr9TJetTtcJad hmWl2W1vFcED067LZug97eJ5+Q7FIeeu1kYCxG/vMhtggj5tokfKfRygxXU0ZXheMwRt +BYY3ZsfvM6UDfC9wHs2Pt4Baf1P6dIian2UvZOFNc44W1DmVA8KAtDPCGoVgZW4BhTq cAmA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=1utpQ0yJqtsDqBEyyfPbUT4SYzv7GLmM1OwsCx0o8h0=; b=top8hDiZeRqN6MmtDvAyU7v48WXsl/O9fhNbpN+YMSBlhc+HyNUuAlM6degHswi6sD v9jRmdYOiVkeX7GXxWqVzqVmszR3JQYIZsnHBUfN7S3ZYshVdvXEA+FK+4QR3GTHUhGa 6hs6eiJP+u2CRMNQ0hx2JscMBZbYLWnjv+OSKjnFza502WzRy4GwstsEsdUB01l7KYay LyafLAvSPVn/OFYBQa1zWMQWZFf6piKvbroGzmJkI/KAhYHaTQQ24CWkGmfivhvCk/VA Klq9FORxA3+moE9CMv6mGDwKYLDcqvuaCZdPQMOSlZUBxUgEtS4fZx4GvjbQmTA4OCXc aHpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr:from:to:cc :subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=1utpQ0yJqtsDqBEyyfPbUT4SYzv7GLmM1OwsCx0o8h0=; b=lqCnsaElq60AT5f3D4qwXseNhc/jgdEN4oJy2whBa7Y6uKisH4McfC77bU2grK2Bex XrpBw3b/GirvZhhRuuE+nHgRWEW4C715R3kcTu9x+FcAWQoDOYWsNzaa0Q/FEbrggaj7 jahcMrzsUvoqicpbdJtnUIsqIkYX5FRPfYuNdYq9UNjmMX3G/zMQ2JIbJbPESXCuNedi l0443+Mmgs11DLiCjH7JjeR+uWhnR9Z7pIWMXI9WA/Vh6G47bi5PUi+jEMeTzDCxxcqz qzwy3ckyKhKo0RDE8xFoFodQxqwegYSc4MTq78XtynXabpewKvrkJIGZ4jO/Gq78IPJ/ OnSA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PubPjCX/kkIpsr88RoQhAmnhpIunFRwZFor7Xt6A8rXyY6Hn3lP7 Iz4XzPDfUvHxXr+D2kFNn2E= X-Google-Smtp-Source: APiQypJyYz76umQDRk/tUR5yN6ZJ0ilsUoSTLFbH2d9/Il+8DoNXDWltjUARyx4K0hXQB9/gfiB7dA== X-Received: by 2002:a37:6852:: with SMTP id d79mr15394518qkc.388.1586766883728; Mon, 13 Apr 2020 01:34:43 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a0c:b3d4:: with SMTP id b20ls6831085qvf.11.gmail; Mon, 13 Apr 2020 01:34:43 -0700 (PDT) X-Received: by 2002:ad4:5988:: with SMTP id ek8mr8016741qvb.18.1586766883061; Mon, 13 Apr 2020 01:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586766883; cv=none; d=google.com; s=arc-20160816; b=VCvAmalK/lTgHOCi3b/wd2ZDPHH0eJVowY4KOAR+lD4oIWLhTIBiOnlmXT94mCb+W6 11LfUyMmmu84pPoscb0+NypLRtBpaoTKgkPaor1XJCbraSC8tZUNRUSJdGLcZlVTBD8O u9JYFiy53WqGBTIFD7NMKJkvZ/mttu1x/UAbXBZRQaOXX+WWHxxtHM7RpA+8qfOo4afk OYO5yYT8KbA1JXB1+aVgMUPGa/QRLM3xLL+1d7SxLig5ivStR+ynHIBooty8VQ97b/bO zNFAvHPo7Igash3qi7Sj8Z+P0OMVc1qmP/q9xaeJn6XDOLI4UXkoUVqpdI/WluvI/gmm bn8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=+LM7+AF6PXxfgkMLlcn5bxzuadbYhpsMbig286IJgA4=; b=IyiMTGmOFtNK7z1WA68xVDyF9cBOGO5Ec6w7XSvwv/mzZ5+fyt3G/BSPeh4vTd+4rD juXNlPzPt3K5WHbUIMvKXM17r16g7ipJW227iG7uULV2boRAtow8WEBwhWSfHVZXRkJG v7o1xiqLtnTVt9GeA1DyoxpR3enBcT0/9ZuQOK+5Cdkpxib+iSUnTH3zbapgC20ciWQk 9ffY+3sKy1ZxfbnSjysDgqyWPkIv5qDn+4xYjNtTjCole31eY+SLM0xtEMBMWsKGe+zF uNSxT7+y/Ty2z1VyECA66BYsFIJz1JuBRcQ3HjlxywM2bHyjJ+ebvt/kXvKEAWBFUTHg vc+Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id p32si490295qtc.2.2020.04.13.01.34.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2020 01:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; IronPort-SDR: Km4VnGGILpgVeLPtuMFBcJ9/4cmBRZbXTenIRsBWgJwjmwNmApW9QGdyEFIm0ejod4Iu9SV/uG Fa6CPF7zhhoUV1PbwpYM4qVQjCat9stbwST/S3akpjEZ9MqFU8pgZofH5jajdgaIaiZ9/hhLZb qaTkm30m4XuUB1cN5u6+JcCkYb2CUirakaefBZaWMFapCz0lauji13clDPziFvrx3gBLuKXs+7 uLnE/bfoE7xP93JePhftj/FH0o595YZ/EWQVvyQq25PEmwh5LWMwYMYsXYkMlPj9WqAYzqK0wx iLs= X-IronPort-AV: E=Sophos;i="5.72,378,1580803200"; d="scan'208";a="47602053" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 13 Apr 2020 00:34:41 -0800 IronPort-SDR: 9LVhYKreNILMF3Mi1R0uH4XcyQe1ng6yh7XbUH6MnyANxh+Cv+QZxMXz40dhPcFBwQwhbCD+sT GETh/dGrbovFj/Tlu4lpoJxGf95Rh63GQI3o9Vt03sQBw7cGrVpLSxA5wYUoUdNVBW7/j2bPUA +uLPRFBcG2uMGpM3iJiBEmIAX0MdiYsrM173tCz3wX8P2lIFXKxpYXWxqrruQkNNtBKCu66Fo8 /v5KtO2hKKXFnCW7eA5o+LAXlRaq4yG96dMSr/MwCZz9Cz5XgVHm3qRpL3WGzd2qB1/Pr/IbUn gLA= From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [swupdate] [PATCH] hawkbit: process_notification_thread shall check data_avail before status Date: Mon, 13 Apr 2020 10:34:12 +0200 Message-ID: <1586766852-208-1-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-Original-Sender: cedric_hombourger@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Add missing check for data being available in process_notification_thread() It would otherwise cause read of uninitialized status data (as reported by valgrind). Signed-off-by: Cedric Hombourger Reviewed-by: Stefano Babic --- suricatta/server_hawkbit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 0b0e00b..a4638af 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -942,7 +942,7 @@ static void *process_notification_thread(void *data) stop = true; } - if (msg.data.status.current == PROGRESS) + if (data_avail && msg.data.status.current == PROGRESS) continue; /* * If there is a message