Message ID | 20200405094441.9979-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::13c; helo=mail-lf1-x13c.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=KsQYgW2E; dkim-atps=neutral Received: from mail-lf1-x13c.google.com (mail-lf1-x13c.google.com [IPv6:2a00:1450:4864:20::13c]) (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 48w80R0s7Vz9sRR for <incoming@patchwork.ozlabs.org>; Sun, 5 Apr 2020 19:44:53 +1000 (AEST) Received: by mail-lf1-x13c.google.com with SMTP id y19sf3721846lfk.13 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=tZU0sOAqGw/MwOl+h8xQ/WuLg3KWT1KEGF7wzrvoknMvyHZPhbxdadb7D+zG3EP8Ca QbHVcOeU67/VHzSTawEwOg7aUiTnm6WJhPgmXkpo4Z/qGOT81/zyW9uEbEsTzWwzBmU/ H5oRuEideYd9GYu2fHX3KzrUN+6U/OsJQCbUfQ2tB+iFIzHVlwMmbo9vxqOKGlUlf9UX 9U3IXG9D2kupDXU3OevU3BwCCpd7yu/kv4PTXBdjbUsEUHI90jE5zneiZjjo0Ye1PQEm V7UfU8lDJJ0VAjIuhNqv6SCHvR1xhab3s5xWHtp2bkFa0QPmYBWJAiQr2+qH3LowV7j/ VCVQ== 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=Q5Aj6ULYIALcJYb23Dw/rxo6IIbaYoDHbRxoPHsUcxg=; b=mj00AXz6XrNQB9hI5GkwLUOFxhjLKZm0p44TwaOUW7rD3yjTDAzqthBZy90iUzHmQQ lMgZGDbeVB9XvUPZmFcriAuX2uwimoX9C7GrSjb5IPegTx/yB9jWHjKse6tQwcnU00JI YmFzMhcyJWVOfMPZVTJX8/BOFRKVLe6qhIcDHFvEdHMrxSuz2LfGzZHLcPv46CR1AT6R qtp9P9U4FJZSIS/gg3YsQhup6mf68UBTZk5Wt5ZAL5nQXLJOcf5iKm0E2udHMEhr5EiR PPrpAN0JOTlrx21VFgDMQNFWMEqhNdCNAHHTRD7uS86p+xC2scej6yWHBemwTbP0Jsjl 1hYg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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=Q5Aj6ULYIALcJYb23Dw/rxo6IIbaYoDHbRxoPHsUcxg=; b=KsQYgW2ExLL/tEoj2tzRHdivNO1od7a1yAvJKUQT3I3mU/Yemg2dqfYAAqHzSo2s8X Hni1xVd/OiLCataNmaNY/hlhp3moeoGBaOrT8ab+GmSycrx31NYI/BVpIyIv05Agvj7W lGUgXs2RboDH7MitSHJbqYhtBiXbEMYjAOiTzEEo2nwc8ZTvNJffZQZnawvbZcMWzSUj HPB4AhKuXcoduKZo4Eq5whUH9xPkG+vIWoZzxFYmQ9koDdVG8ZuZfesoDpQY7rCI+WMK B3GdD6nxmCKTWw/9W0kJibI8uSBR6MZCDxKUis8UgnGd046iBPjHqFsUTnyUhaMjW0Z/ 6ybg== 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=Q5Aj6ULYIALcJYb23Dw/rxo6IIbaYoDHbRxoPHsUcxg=; b=XCgeW23qjDt3lE4jbsbE2m+Z7aD8N4wvtVxRTgldf+++PK0k6V7WYplbN+tC/v5S63 EpeZ5nrf3CoCNO0eFcThfs1rsl+FZ7CkuFRitf2eaL0z87SAuZMVjR6karEHLUMRCZcJ ZCWmGcv7oZH65j7U8kTvxCnfPP7i4hy2sThNVT/hgMm7OiEMzEuOtsX3lPSn2Eo9f/nE juvCwWL9Ci6FBAzhBaWzcm4imr8y3NbLxw7YbKLXpXl1bH2AkO1cDU+EnqvuaCIKmj8k +ICp75qMVRihVy6SE8pB2AS0/p6iYgHhb3zgHbnMYAjfVN/61FcIugLJbLlM6AcQ4Jsp 4Luw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PuajRp854GVajRBwGG7ce2fiXWAt+MJYDzBAv99m9IDrxvhZdqm9 34bXpcnUj+zmFXN1ZGrMMUI= X-Google-Smtp-Source: APiQypL98ZRTKJ+GYYc6g9iA4DYSuqfFTumFK2jOJip/BzkavF7Vg/BhEalQwoWlO7vhK8bDVnWA3w== X-Received: by 2002:a2e:9815:: with SMTP id a21mr9385886ljj.180.1586079887966; Sun, 05 Apr 2020 02:44:47 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ac2:5a0e:: with SMTP id q14ls1527984lfn.3.gmail; Sun, 05 Apr 2020 02:44:46 -0700 (PDT) X-Received: by 2002:a2e:87d6:: with SMTP id v22mr9696536ljj.155.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=Ks1pfKTsEJUTWmG+sVY+X48YLvn4dSesW2muQ7OfJ/hXpS+Vaii9pycRNzomcDml9f iYQscnJr+UhIuzTn9til0U9vHoxCkYwZDw4ADycirenBGWMMZnTqrLI8Ngqp/SOiAiPe 5wvlLtTqKPqFPdRcU0+P2pqJS+2f6v7bc7RIZE5RAz0xKeT54lj+nsfEL+Xr3Qflqkyl Ru2AUeG7o59dmK56GgUOItn3f/ehzW1sbMgIzpjC8P2xYBnpQampf/DF4lMLLMbkydx+ 7JOeRNqj4DdWLnQ/VDotaSe9bVFZt/gia1g4Yk+cogyyDdY8LGQvwkQqVJZZWg28ZvzV Vviw== 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=H6nZTBN2pO/N6KsxPU38DZfImRBfKAzCvokcV9olnSg=; b=ovBWVXA6G7iokVFrqn+I3NaAPqJWXObEenYQ8azwSPagOMzkB3ib21SiENw4Ihp/IO yJUjIgbCRFUc4QK9cnKsBFzYCXGFleyw7Vmn8oj2eLifnZyUDfYEbX1RuTCrQiWWj+Xd ns1GmBgSFesjLGCnas6AqhX8YydGONO+LZeUjUd4Iu1907LbaurinWUfH/XYLSXU1CPb 7sqc6SDhDpXaBBjf6NZ9lssYAN9jgzN8SrB/b2BNm89zNcsq+q/BPvRN9rQdc7PfF0vc +305WIB4f2denNu5p1j+JZC0kf9CGa5h0UAZ6/xHTNWumQxb/qJRD1Xt4dtZp3QIZJbQ X07A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id h8si981007lfm.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: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48w80F4GwZz1rpG2; 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 48w80F43YKz1qqkk; 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 ugf7_bIurre3; Sun, 5 Apr 2020 11:44:44 +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:44 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 344174540646; 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 lQiXpeWWOk5e; Sun, 5 Apr 2020 11:44:42 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.38]) by babic.homelinux.org (Postfix) with ESMTP id ACD4C45403BB; Sun, 5 Apr 2020 11:44:42 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH] diskpart: replace LIST_FOREACH with LIST_FOREACH_SAFE Date: Sun, 5 Apr 2020 11:44:41 +0200 Message-Id: <20200405094441.9979-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: 212.18.0.10 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 |
diskpart: replace LIST_FOREACH with LIST_FOREACH_SAFE
|
expand
|
diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c index cd3b042..ea20438 100644 --- a/handlers/diskpart_handler.c +++ b/handlers/diskpart_handler.c @@ -105,6 +105,7 @@ static int diskpart(struct img_type *img, struct dict_list_elem *elem; struct fdisk_context *cxt; struct partition_data *part; + struct partition_data *tmp; int ret = 0; int i; struct hnd_priv priv; @@ -279,7 +280,7 @@ handler_exit: WARN("Error deassign device %s", img->device); handler_release: - LIST_FOREACH(part, &priv.listparts, next) { + LIST_FOREACH_SAFE(part, &priv.listparts, next, tmp) { LIST_REMOVE(part, next); free(part); }
Fix Coverity #292211 Signed-off-by: Stefano Babic <sbabic@denx.de> --- handlers/diskpart_handler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)