Message ID | 20200405094442.10024-1-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBD6RU32AKGQE7ZAG32A@googlegroups.com> 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=2a00:1450:4864:20::13b; helo=mail-lf1-x13b.google.com; envelope-from=swupdate+bncbcxploxj6ikrbd6ru32akgqe7zag32a@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de 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=GeeqCmu7; dkim-atps=neutral Received: from mail-lf1-x13b.google.com (mail-lf1-x13b.google.com [IPv6:2a00:1450:4864:20::13b]) (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 48w80R0wm9z9sRY for <incoming@patchwork.ozlabs.org>; Sun, 5 Apr 2020 19:44:53 +1000 (AEST) Received: by mail-lf1-x13b.google.com with SMTP id l5sf4064418lfg.3 for <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2020 02:44:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586079888; cv=pass; d=google.com; s=arc-20160816; b=f/5p4rRqDfQG6AoQNj3VnU+7u1baGNdkhgdbNRMbUFiwDTk+dEI5WQLExaFzKjBcmu kp9+8IAIlbbSEOKm9KoaBsj+s3WQ30LDrg1uo142eNQyOLA3zuDNm9QqOdpw99DNmJQA gKZKbvZIbhYbkpF1RXaU0HmhFXqYiruJt+keE0svveVv7GvuM+GWY7ZIt2NM6v+BeR9k 9ZKPPBT7U/gbpNt5WG7UNLXIUgi8qeLmuXmFKlHqIuCZZLq3m55fdvgy0i3w8kX3B8j/ /AwoTrFTxeeBR+zWeZrWFounZOvy+ZbsGbTediOa2vnHQuPxLSarAj8etpBk0PuESH9K JHFg== 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:sender:dkim-signature; bh=iHONhjK+eihvN4O85IzXmIpifCbRSz6XPLMlvbutZr8=; b=hrArhZCbly8r0xax/ZuS/p9jkwsRThIOKdgQ+CLcvgOa3oYO6wDfRAvuYEgdvPrnP3 PZIGrmjYNlxskIMwtM7eSwhilLj/3rDVVX8AV5Nl5j3uTRdnZRjEmwbGRe31L0urHqQ6 STOE/PP8qEu6yB2c3LIbnbXbUm6ELyq6ClUxNYEDJPpXMlc3ZoPfECBjn0/cKWLavoLE kkDFNiYGbQ5lC9WuJcMAnR9imhP2/TCJSKcXl7IV5ygOZtYxG/1tQf44qFcJfT50L+t2 KQKNwhgvKMvbgMPvfev2Wh3Ihsg8iWv8Uv5RHWA5paLWNVpCFps77toudkyVFFHsTrzU BY8A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender: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=iHONhjK+eihvN4O85IzXmIpifCbRSz6XPLMlvbutZr8=; b=GeeqCmu7No2p48wnWeWPU4wh3Ex0prUTSAPysETyZ8HNt+vnq0WF4P5EoCLzJIkBsG xvxsep4ndGpGGGKg48n3Yd1r26Bfkd/ba19h8ikPTnkffM8R02d4A5xiJgpLaTPajxJ3 Z3rDS27y0bTwT2/W6PzT6CS9KSyj9g8p4Ad2UD8zKurds3Mcx34VwbLERvkQU06xMWGg iEiY+1zQy1WeyRC9h5xCq+l+z9JsvAoEIwpflGZjyOgxckmCGrsBPxMxBy9Yw5acEIOp +mbU5ZUwTaoS9ej28WUI7syigoXT/tYtE1e+8xkWNjWHxEHMiIkOrbc/6/Pii2UfQxWN 24ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state: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=iHONhjK+eihvN4O85IzXmIpifCbRSz6XPLMlvbutZr8=; b=hUwqy1uBG1a5sfi2aDGuntZ+LYMe9aSu04It0bzJLZx81Ip2tgCEd5TmeuFlUK/zcA scRYWzMUfDl/n9mcr9wD+6ZD4aFdOhr6IdB+0ybV7qGn3IsnXWipz2Pssztf2Xtr6K/X LoyYfY5386qT+QQbnQLO4zf6X5gaH7fYu9pnInGO8u/35iAPg/+nmt91VGFMzZzvd2fr JOGqb7qoiAro7bbfkDf0QXO53RtMo5pjtL0rtp/zdoIH9aqeqRhOhPys0A5N8ojtbNDk rvnJY9qAQBBXbnt9nnSZpbqk1tHrnVNT60mDle32gwY8eJiSKwY9P1GtBKFi0i4WkGua 92fg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PuZZtAevGvE/ZBCHGm6yGrgQTnHXkoj3Wzmp11enPhAZsOoloCl5 dlDbSv3BD7JlzpGpiMqVrMY= X-Google-Smtp-Source: APiQypJHpCRsfqlsOyxYpuVEWHOcCMmBd+qzXAGDzwtZvple+49HnXRvoIoBZ/d5qTpBpR4XNS5q7Q== X-Received: by 2002:a2e:3603:: with SMTP id d3mr9336961lja.82.1586079888146; Sun, 05 Apr 2020 02:44:48 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ac2:41d5:: with SMTP id d21ls1515970lfi.11.gmail; Sun, 05 Apr 2020 02:44:46 -0700 (PDT) X-Received: by 2002:a19:88a:: with SMTP id 132mr10320203lfi.130.1586079886714; Sun, 05 Apr 2020 02:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586079886; cv=none; d=google.com; s=arc-20160816; b=DfcSbz1WrK7KMY3XwYEuweYQjq0u3IHtDa7SQK0ogP5ho8eESo2zEpGfwzoiLKzBZX LQsbHRny+x9GS7feDgPp/p4LB2Pl2fdztbemzhtzocFqdExg0o0GzGJrsUj0bczKFvo1 P4ANRy+cRtQALMbwoNOo9eFDuA4nQPzqJScr0a6wpDqr58q4WeD7A8jHBtRaqUMjbjAX DwHHZnayJlSC1+4Jy4KJubjZuai7eLRdKyWr8mlojA/UGerSqRVPxSxB45VdOKeKQVqm woOkBRExcCrYXz2KDDhp0Xp/HLWavzXotYzEj6vR2FuMQ2dY/tA0P/RdCzcTN6oAkxX1 FHWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=N0DKlatBX9Z6BvNZfp9IyUuFcmEmtMilzKKzBwAi5SU=; b=UBJkfv7Yxb8jJr6R1IQVaeEdk63NnXrWjTlIJhwexzTWNIvpzh2qgcsFUmpIo0r5Nm YcaxM8fNpC5n7Pf+rgoRTfs9kT0MuSKRQg+G5VE7OcLIYIxizULjnLf8vSdRJ4iv/acl VYnzwCaXCKVEuE9PF8do2vtf5PSRrkd0XWxZ+KIEZfnphZKTrbeom777zdgkHnBevxeq kDXcwAlOWoluneQfY7oyrSdOvTVDE+fFROFkZOfbSWTsPjAyooTXazUCwxF/JLf01pYC T1/R+ROMCfg8Bcwjc/fqe9FubilFNTYKAQCGHW//3awsf0JY8v3wbfffOjjOb9TUKlGI 9uzw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id h8si981008lfm.5.2020.04.05.02.44.46 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Apr 2020 02:44:46 -0700 (PDT) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48w80F6k5nz1rpf2; Sun, 5 Apr 2020 11:44:45 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48w80F6S6Dz1qqkk; Sun, 5 Apr 2020 11:44:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id dGkZ9DjNQxMe; Sun, 5 Apr 2020 11:44:45 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sun, 5 Apr 2020 11:44:45 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 96A36454065B; Sun, 5 Apr 2020 11:44:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id hK9s6faz6CKP; Sun, 5 Apr 2020 11:44:43 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.38]) by babic.homelinux.org (Postfix) with ESMTP id 21D204540555; Sun, 5 Apr 2020 11:44:43 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH] parser: replace LIST_FOREACH with LIST_FOREACH_SAFE Date: Sun, 5 Apr 2020 11:44:42 +0200 Message-Id: <20200405094442.10024-1-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
parser: replace LIST_FOREACH with LIST_FOREACH_SAFE
|
expand
|
diff --git a/core/parser.c b/core/parser.c index 38d4973..e7e68ea 100644 --- a/core/parser.c +++ b/core/parser.c @@ -198,9 +198,9 @@ static int is_image_higher(struct swver *sw_ver_list, static void remove_installed_image_list(struct imglist *img_list, struct swver *sw_ver_list) { - struct img_type *img; + struct img_type *img, *tmp; - LIST_FOREACH(img, img_list, next) { + LIST_FOREACH_SAFE(img, img_list, next, tmp) { if (is_image_installed(sw_ver_list, img)) { LIST_REMOVE(img, next); free_image(img); @@ -214,9 +214,9 @@ static void remove_installed_image_list(struct imglist *img_list, static void remove_higher_image_list(struct imglist *img_list, struct swver *sw_ver_list) { - struct img_type *img; + struct img_type *img, *tmp; - LIST_FOREACH(img, img_list, next) { + LIST_FOREACH_SAFE(img, img_list, next, tmp) { if (is_image_higher(sw_ver_list, img)) { LIST_REMOVE(img, next); free_image(img);
Fix coverity #292209 Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/parser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)